C - While Loop
C - While Loop
while loop
• While loop is also known as a pre-tested loop.
• In general, a while loop allows a part of the code to
be executed multiple times depending upon a given
boolean condition.
• It can be viewed as a repeating if statement.
• The while loop is one of the most frequently used
types of loops in C.
Syntax of While Loop
Example 1
Prints All the
Lowercase
Example 3
Example 4
Example 5
Example 6
Example 7
The Do/While Loop
The Do/While Loop
• The do/while loop is a variant of the while loop.