how cone the answer is 5 ? it is greater than for so the while condition is not satisfied hence the ans will be the input itself i.e. 2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how cone the answer is 5 ? it is greater than for so the while condition is not satisfied hence the ans will be the input itself i.e. 2

9th Sep 2016, 4:20 PM
Henal Shah
Henal Shah - avatar
2 Answers
+ 1
int a = 2; do { a+=3; } while (a < 4); Console.Write(a); The while condition not being satisfied means that we exit the loop after only 1 turn (which is the minimum for a do while loop).
9th Sep 2016, 4:26 PM
Zen
Zen - avatar
0
the program gonna do the "do" statement cause he's before the while... if the while wasn't satisfied the "do" would work again and again
26th Oct 2016, 2:37 AM
∆Gusta∆