- 2
A loop in c++
please help
6 Answers
+ 19
Guys I realised what he wanna do... He wants a loop to increment a number depending on current number..
If its less than 10, increment by one, otherwise if its less than 20 increment by 2 and so on...
+ 17
Longest tag ever! š
+ 13
Did you skip your course or you are stuck in the lesson?
i am not a sidekick.
i can't read your mind.
please type which C++ lesson your now
+ 10
Good observation @Gami.
int i=1;
while (i < 33) {
cout << i << " ";
if (i < 10)
i += 1;
else if (i < 20)
i += 2;
else
i += 3;
}
+ 8
for (int i=0; i<33; i++)
cout << i << " ";
to print numbers from 1 to 32.
+ 6
what is your question? Which loop would you like to use?