While Loop
While loop
The while loop is entry controlled loop. The while loop keeps on executing the block of statement till the specified test condition evaluates to true. When the test condition becomes false, the program control is transferred out of the loop and passes to the statement after the body of the loop.
Syntax:
While(condition) { Statement 1; Statement 2; ………….. Statement n; }