Can we use do-while as dummy loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we use do-while as dummy loop

Like int i=10; While(i); { i--; }

21st Feb 2020, 11:38 AM
Devineni Pavan Kumar
Devineni Pavan Kumar - avatar
3 Answers
+ 2
int i=10; do{ i--; } while (i);
21st Feb 2020, 11:49 AM
Avinesh
Avinesh - avatar
0
Why not just like this though: while(i--);
21st Feb 2020, 2:22 PM
HonFu
HonFu - avatar
0
example int i=12; do{ i++; } while (i);
21st Apr 2020, 9:51 AM
deepak sharma
deepak sharma - avatar