C++ Array Loop Through via for statement
#include <iostream> using namespace std; int main()/* ww w . j a v a 2 s . c o m*/ { int myArray[5]; for (int i=0; i<5; i++) { myArray[i] = i * 2; cout << myArray[i] << endl; } return 0; }