1) While loop checks for the condition first so it may not even enter into the loop if the condition is false. 2) do while loop executes the content of the loop once before checking the condition of the while. 3) For loop is similar to while loop except, the initialization of variable, condition check & increment happens at one place.
1) While loop checks for the condition first so it may not even enter into the loop if the condition is false.
need an explanation for this answer? contact us directly to get an explanation for this answer2) do while loop executes the content of the loop once before checking the condition of the while.
3) For loop is similar to while loop except, the initialization of variable, condition check & increment happens at one place.