C while Loop statement

C while is loop statement is used to do operations till some condition is true. 
For example, to print number for 1 to 100 we can use while loop statement.

Syntax of while loop statement:

while(<condition>){
<body_of_while_loop>
}

<condition> : is condition which will be checked on every iteration of loop. <body_of_while_loop> will be executed only if this condition is true
<body_of_while_loop> : statement(s) to be executed 

Flowchart of while...loop:
flow chart of while loop

 

Example of while...loop:
In this example, we are printing 1 to 100 numbers using while loop.