|
think of it this way...
1*1 = 1
1*2 = 2
1*3 = 3
What do they all have in common? it's always 1 times something, until you get to whatever you want the next number to be. In your case it's 4, so the code would be...
assuming you know basic include functions, how to start off the main function, etc. (if you don't just ask me):
for (int i = 1; i <= 4; i++) // starting it off as 1*something, and continuous-
{ // it will increment i by 1 after j hits 4 and breaks
for (int j = 1; j <=4; j++) // the loop
{
cout << i << " * " << j;
}
}
return 0;
|