123456789101112131415
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { double length[] = {32.45, 54.56, 32.45, 92.00, 5.29}; int index = sizeof(length) / sizeof(double); cout<<"Array members: "<<endl; for(int i = 0; i < index; ++i) cout << "Length : " << i + 1 << length[i] << endl; system("PAUSE"); return EXIT_SUCCESS; }
cout << "Length " << i+1 << ": " << length[i] << endl ;