Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Looping Statements

In C

By- Mohammad Saad Qasim


Roll No.- 22015000169
INDEX
SR.No. Content Page

1 What are the Looping Statement

2 Types of Looping Statements

3 For Loop

4 While Loop

5 Do-While Loop

6 Loop Control Statement

7 Nested Looping Statement


What are the looping statements.
♦ LoopingStatements allow to repeat a block of code
as many time as we need.

♦ Don’t have to write code multiple times.

♦ 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

for (initialization; condition; updation)

{
//statements to be executed.
}
Flow Diagram Example
// Print numbers from 1 to 10

#include <stdio.h>

int main() { Updation


Condition
int i;

for (i = 1; i < 11; i++)

{
Initialization
printf("%d ", i);

return 0;

}
Output: 1 2 3 4 5 6 7 8 9 10
While Loop

You might also like