What is the difference between while loop and do while loop. I used to think both are completely same.Then I came across following piece of code:
do {
The most important difference between while and do-while loop is that in do-while, the block of code is executed at least once, even though the condition given is false.
To put it in a different way :