Question about FOR loop.

Hello, how can I get FOR to type "number 2,x and =" 10 times without any increasements ? And how to increase number by two instead of one ? I need to use FOR in this one. What I need to get done is something like this:

2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
2 x 10 = 20
closed account (48T7M4Gy)
What is an increasement?

1
2
for(i = 1; i <= 10; i++)
  cout << i << ' ' <<  i * 2;
I need it to get to type 2 ten times, without that number getting any bigger.
closed account (48T7M4Gy)
1
2
for(i = 1; i <= 10; i++)
  cout << 2;


or

1
2
for(i = 1; i <= 10; i++)
  cout << 2 << endl;
Last edited on
Thank you very much ^^
Topic archived. No new replies allowed.