Professional Documents
Culture Documents
Looping Statements Inc: By-Mohammad Saad Qasim Roll No. - 22015000169
Looping Statements Inc: By-Mohammad Saad Qasim Roll No. - 22015000169
In C
3 For Loop
4 While Loop
5 Do-While Loop
♦ Controlled Execution.
Types of Looping Statements
For Loop
♦ Used when number of iterations is known.
♦ Entry Controlled Loop i.e condition is tested before iteration.
Syntax
{
//statements to be executed.
}
Flow Diagram Example
// Print numbers from 1 to 10
#include <stdio.h>
{
Initialization
printf("%d ", i);
return 0;
}
Output: 1 2 3 4 5 6 7 8 9 10
While Loop