Take a look at the while loop below.
int i = 0;
while (i < 10)
{
cout << i << endl;
i++;
}
The above statement can be rewritten using a for loop:
for (int j = 0; j < 10; j++)
{
cout << j << endl;
}
Comments
Post a Comment