Hello. First post as a very newbie to C++ programming.
I've been working through the exercises in the C++ for dummies book version 3 and got to nested ForLoops and hit a brain block!
Here is the code and the output i get when i run it in my compiler.
I understand the "products of" output but where do the first set of numbers come from in the output file?
Thank you in advance for anyone who helps me understand this! i'm reluctant to move on to any other exercises before i understand this one, the next one in the book has a break in it and thats melting my brain too :)
#include <iostream>
usingnamespace std;
int main()
{
int x,y;
for (x = 1; x <= 10; x++)
{
cout << "Products of " << x <<endl;
for (y = 1; y <= 10; y++)
{
cout << x * y << endl;
}
cout << endl;
}
return 0;
}
OUTPUT displayed when run is:
27
36
45
63
72
81
90
Products of 10
10
20
30
40
50
60
70
80
90
100