Loops and Arrays
#include <iostream.h>
void main()
{
int age[4];
for (int j = 0; j < 4;j++)
{
cout <<“Enter an age : “;
cin >> age[j];
}
for (j = 0; j < 4; j++)
cout <<“ \nYou entered “ <<age[j];
}
Previous slide
Next slide
Back to first slide
View graphic version