two for statements and using pow()

Here is my problem:
write a nested loop that displays a table consisting of 3 rows and 11 columns like so:
1 1 1 1 1 1 1 1 1 1 1
2 1 2 4 8 16 32.....
3 1 3 9 27 81 243....
Use two for statements and the powe () function. At least one of the function's arguments must be a double number. This is a C++ class I'm taking and any ideas are appreciated.The program doesn't need to print just run it as a win32 app.
1
2
3
4
5
6
7
for (int i = 1; i <= 3; ++i) {
      cout<<i;
      for (int j = 0; j < 11; ++j) {
           cout<<" "<<pow(i, j);
      }
      cout<<endl;
}
Last edited on
thanks abunch I was missing the cout<<i:
Topic archived. No new replies allowed.