- 2

A loop in c++

please help

31st Mar 2017, 2:11 PM
nborichie joshua
nborichie joshua - avatar
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...
31st Mar 2017, 2:41 PM
Gami
Gami - avatar
+ 17
Longest tag ever! 😐
31st Mar 2017, 2:38 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 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
31st Mar 2017, 3:34 PM
Agus Mei
Agus Mei - avatar
+ 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; }
31st Mar 2017, 2:45 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 8
for (int i=0; i<33; i++) cout << i << " "; to print numbers from 1 to 32.
31st Mar 2017, 2:38 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 6
what is your question? Which loop would you like to use?
31st Mar 2017, 2:13 PM
Mario L.
Mario L. - avatar