what is difference between while loop and do while loop

While:
  1. entry control loop
  2. condition is checked before loop execution
  3. never execute loop if condition is false
  4. there is no semicolon at the end of while statement
Do-while:
  1. exit control loop
  2. condition is checked at the end of loop
  3. executes false condition at least once since condition is checked later
  4. there is semicolon at the end of while statement.

Comments

Popular posts from this blog

Area and Perimeter of circle program in c

Apply a motion path to text or an object

IP address