+ 1

If the question is: print all the odd numbers between 21-50 using for loop...then how will be the format

23rd Sep 2017, 5:07 PM
ishita gupta
ishita gupta - avatar
4 Answers
+ 3
if u cannot convert while loop to for loop.. then please first learn them properly. and make sure that u try of your own first.. well here's it in for loop.. int i; for(i=21; i<=50; i++){ if(i%2!=0){ cout<<i<<endl; } }
23rd Sep 2017, 5:17 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
+ 1
int i=21; while(i>=21 && i<=50){ if(i%2!=0){ cout<<i<<endl; } i++; }
23rd Sep 2017, 5:15 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
0
I said using for loop
23rd Sep 2017, 5:15 PM
ishita gupta
ishita gupta - avatar
0
well I learned" for" loop first I didn't yet started with while loop...n yes thanks.
23rd Sep 2017, 5:24 PM
ishita gupta
ishita gupta - avatar