C++ for statement Loop Through an Array

Description

C++ for statement Loop Through an Array

#include <iostream>

using namespace std;

int main()//from  www .  j  ava 2s.  c o  m
{
    int myArray[5];

    for (int i=0; i<5; i++)
    {
        myArray[i] = i * 2;
        cout << myArray[i] << endl;
    }

    return 0;
}



PreviousNext

Related