0% found this document useful (0 votes)
6 views

C Language Looping Statements

Loop

Uploaded by

vsuhani7770
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

C Language Looping Statements

Loop

Uploaded by

vsuhani7770
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

C Programming Language

--Decision Control Looping Statements—


Day 05

Join us in telegram- click here


Looping statements:
Looping statements are used to execute a block of code repeatedly as long
as a certain condition is satisfied.

There are mainly three types of looping statements:

> for loop

> while loop

 do-while loop

-> These statements help you control the flow of your program and execute specific
tasks multiple times.
Join us in telegram- click here
Syntax:
for loop: for (initialization; condition; update) {
// code to be executed repeatedly
}

while loop: //Initialization


while (condition) {
// code to be executed repeatedly
//increment ”or” decrement
}
do-while loop: do {
// code to be executed repeatedly

// Increment or modification of loop control variables


// Other statements as needed

} while (condition); Join us in telegram- click here


Basic programs for understanding loops:

Join us in telegram- click here


for loop programs:

Join us in telegram- click here


Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
writing the above programs using while loop:

Join us in telegram- click here


Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
writing the above programs
using do while loop:

Join us in telegram- click here


Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in telegram- click here
Join us in Telegram for more:
Join us in telegram- click here

You might also like