Question: what is the difference between for while and do while loop?
Answer: In while and for loops the condition is checked before the control enters the loop. In do-while it's checked at the end of the loop. Syntax-wise, in do-while there is a semicolon at the end of the condition. In while and for, there is no semicolon after the condition.