C while loop

The while loop calculates the expression before every loop that is it checks for the condition to be true or false. If the expression is true then the block of statements inside while loop is executed, and if it is false, the statement will not be executed.

Increment or decrement of the expression is done inside the loop.
Its the ability to check the condition at the start makes it entry-control loop.

Syntax

Example

Output