C Programing – Idea of Looping Statement (While Loop) – Part-2


While Loop

WHILE – WHILE loops are so easy to understand. The Loop will repeated until inside while condition is true.

The basic structure is.
while ( condition )

{ Code to execute while the condition is true }

ExampleWhile Loop:


void main()
int x = 0;
while ( x < 10 )   /* While x is less than 10. in this section can use Boolean statements like (x==1||Y==2)*/


printf( “%d\n”, x );
x++;                                                         /* Update x so the condition can be met eventually */

Output: 0 to 9


About Author


Former Asst. Manager (IT) - MGH Group MCA (Masters in Computer Application) From Sikkim Manipal University India. Have 5 years experience In IT field.

Leave A Reply