While loop in c with example

While loop is simplest loop in c


Body of the loop


# If body of loop is only one statement than braces ({}) are not needed.
# Body of the loop may have one or more statement.


In while loop 1st condition will check if condition is true than body of the loop will executed. After body of the loop is execute, the condition is again tested if condition is true than again body of loop is executed, this process is repeated until condition is true. When condition is false than statement next to while loop is executed.


Program to count N numbers

Program to display even number up to 20

Previous Code:-
for loop

List Code:-
C Codes

Next Code:-
do-while loop

C Programs
List of c Programs

Leave reply

Add your comments here

Back to Top