0

What is difference between while and do while in c#

28th Jul 2017, 9:11 AM
Mohammad
2 Respostas
+ 2
while is entry controlled loop do while loop is exit controlled loop entry controlled loop : check condition before entering to the loop. exit controlled loop: check condition after reading the Statements with in the body of the do while loop.
28th Jul 2017, 11:37 AM
Sreejith P
Sreejith P - avatar
+ 1
The difference between the two is that while...do loop controls the condition at the BEGINNING (before it starts), and do..while loop controls the condition at the END (after the first execution). In other words we can say that while...do could be repeat neither once according to the condition and do...while MUST be executed at least once
28th Jul 2017, 9:27 AM
2_3rr0r5
2_3rr0r5 - avatar