Question: what is the difference between for loop while loop and do while loop?
Answer: In while and for loops the condition is checked before the control enters the loop. ... In while and for, there is no semicolon after the condition. A do-while loop executes at least once, regardless of the condition. This is not true with for and while loops.