SlideShare a Scribd company logo
C language Loop Control
(for , while , do while)
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
for loop of C language…..
Different types of for loop in C language…..
for loop example with real program…..
[Live Demo on YouTube channel]
while loop of C language…..
Different types of while loop in C language…..
while loop example with real program…..
[Live Demo on YouTube channel]
do while loop of C language…..
Different types of do while loop in C language…..
do while loop example with real program…..
[Live Demo on YouTube channel]
Index
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
for loop of C language…..
for ( initialization ; condition(TRUE / FALSE) ; increment / decrement )
{
Task / Job;
}
int x;
for ( x=0 ; x < 3 ; x=x+1 )
{
printf(“%d”,x);
printf(“n”);
}
printf(“Loop end”);
Output:
0
1
2
Loop end
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
6
1 2
3
4
5
for ( initialization ; condition(TRUE / FALSE) ; increment / decrement )
{
for ( init ; con(TRUE / FALSE) ; inc / dec )
{
Task / Job;
}
}
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
12
1 2
3
4
11
5
6
7
8
9
10
nested for loop of C language…..
int loop1,loop2;
for ( loop1=0 ; loop1 < 3 ; loop1=loop1+1 )
{
for ( loop2=0 ; loop2 < 3 ; loop2=loop2+1 )
{
printf(“%d”,loop2);
}
printf(“n”);
printf(“Loop2 end”);
printf(“n”);
}
printf(“Loop1 end”);
Output:
012
Loop2 end
012
Loop2 end
012
Loop2 end
Loop1 end
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
nested for loop of C language….. example
initialization ;
while (condition(TRUE / FALSE) )
{
Task / Job;
increment / decrement ;
}
int x=0;
while ( x < 3 )
{
printf(“n%d”,x);
x=x+1;
}
printf(“Loop end”);
Output:
0
1
2
Loop end
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
5
1 2
3 4
while loop of C language…..
initialization ;
while (condition(TRUE / FALSE) )
{
init ;
while (con(TRUE / FALSE))
{
Task / Job;
inc / dec ;
}
increment / decrement ;
}
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
1 2
3
4
9
5
6
7
8
10
nested while loop of C language…..
int loop1,loop2;
loop1=0 ;
while (loop1 < 3)
{
loop2=0 ;
while (loop2 < 3)
{
printf(“%d”,loop2);
loop2=loop2+1;
}
printf(“n”);
printf(“Loop2 end”);
loop1=loop1+1;
}
printf(“Loop1 end”);
Output:
012
Loop2 end
012
Loop2 end
012
Loop2 end
Loop1 end
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
nested while loop of C language….. example
initialization ;
do
{
Task / Job;
increment / decrement ;
}
while (condition(TRUE / FALSE) ) ;
int x=0;
do
{
printf(“n%d”,x);
x=x+1;
} while( x < 3 );
printf(“Loop end”);
Output:
0
1
2
Loop end
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
6
1
2
4
5
do while loop of C language…..
3
initialization ;
do
{
init ;
do
{
Task / Job;
inc / dec ;
}
while (con(TRUE / FALSE))
increment / decrement ;
}
while (condition(TRUE / FALSE) )
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
1
2
3
4
11
5
6
7
8
12
nested do while loop of C language…..
10
9
int loop1,loop2;
loop1=0 ;
do
{
loop2=0 ;
do
{
printf(“%d”,loop2);
loop2=loop2+1;
} while (loop2 < 3) ;
printf(“n”);
printf(“Loop2 end”);
loop1=loop1+1;
} while (loop1 < 3);
printf(“Loop1 end”);
Output:
012
Loop2 end
012
Loop2 end
012
Loop2 end
Loop1 end
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
nested do while loop of C language….. example
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.

More Related Content

What's hot (20)

Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loops
bsdeol28
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch cases
MeoRamos
 
Break and continue
Break and continueBreak and continue
Break and continue
Frijo Francis
 
C lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshareC lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshare
Gagan Deep
 
Do...while loop structure
Do...while loop structureDo...while loop structure
Do...while loop structure
Jd Mercado
 
Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
sneha2494
 
Looping statement
Looping statementLooping statement
Looping statement
ilakkiya
 
Looping statements
Looping statementsLooping statements
Looping statements
Chukka Nikhil Chakravarthy
 
Looping Statement And Flow Chart
 Looping Statement And Flow Chart Looping Statement And Flow Chart
Looping Statement And Flow Chart
Rahul Sahu
 
Loops
LoopsLoops
Loops
Kulachi Hansraj Model School Ashok Vihar
 
The Loops
The LoopsThe Loops
The Loops
Krishma Parekh
 
Iteration
IterationIteration
Iteration
Liam Dunphy
 
Jumping statements
Jumping statementsJumping statements
Jumping statements
Suneel Dogra
 
types of loops and what is loop
types of loops and what is looptypes of loops and what is loop
types of loops and what is loop
waheed dogar
 
Loops c++
Loops c++Loops c++
Loops c++
Shivani Singh
 
Loops in c
Loops in cLoops in c
Loops in c
shubhampandav3
 
170120107074 looping statements and nesting of loop statements
170120107074 looping statements and nesting of loop statements170120107074 looping statements and nesting of loop statements
170120107074 looping statements and nesting of loop statements
harsh kothari
 
Nested loop in C language
Nested loop in C languageNested loop in C language
Nested loop in C language
ErumShammim
 
Looping
LoopingLooping
Looping
Kulachi Hansraj Model School Ashok Vihar
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
Zohaib Ahmed
 

Viewers also liked (6)

Basic for Loop in C
Basic for Loop in CBasic for Loop in C
Basic for Loop in C
Rohit Soni
 
Structure in C
Structure in CStructure in C
Structure in C
Kamal Acharya
 
Memory allocation in c
Memory allocation in cMemory allocation in c
Memory allocation in c
Prabhu Govind
 
detailed information about Pointers in c language
detailed information about Pointers in c languagedetailed information about Pointers in c language
detailed information about Pointers in c language
gourav kottawar
 
C Prog. - Decision & Loop Controls
C Prog. - Decision & Loop ControlsC Prog. - Decision & Loop Controls
C Prog. - Decision & Loop Controls
vinay arora
 
C Pointers
C PointersC Pointers
C Pointers
omukhtar
 
Basic for Loop in C
Basic for Loop in CBasic for Loop in C
Basic for Loop in C
Rohit Soni
 
Memory allocation in c
Memory allocation in cMemory allocation in c
Memory allocation in c
Prabhu Govind
 
detailed information about Pointers in c language
detailed information about Pointers in c languagedetailed information about Pointers in c language
detailed information about Pointers in c language
gourav kottawar
 
C Prog. - Decision & Loop Controls
C Prog. - Decision & Loop ControlsC Prog. - Decision & Loop Controls
C Prog. - Decision & Loop Controls
vinay arora
 
C Pointers
C PointersC Pointers
C Pointers
omukhtar
 
Ad

Similar to C program language tutorial for loop while loop do while loop (20)

How to write c programme
How to write c programmeHow to write c programme
How to write c programme
Sourav Ganguly
 
Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020
Osama Ghandour Geris
 
Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020
Osama Ghandour Geris
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
Kiwamu Okabe
 
decision making in c.pptx
decision making in c.pptxdecision making in c.pptx
decision making in c.pptx
DrGAMBIKA
 
C++ programming
C++ programmingC++ programming
C++ programming
viancagerone
 
C++ programming
C++ programmingC++ programming
C++ programming
viancagerone
 
Brand New JavaScript - ECMAScript 2015
Brand New JavaScript - ECMAScript 2015Brand New JavaScript - ECMAScript 2015
Brand New JavaScript - ECMAScript 2015
Gil Fink
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Rebecca Eloise Hogg
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
ChaAstillas
 
Elements of programming
Elements of programmingElements of programming
Elements of programming
baabtra.com - No. 1 supplier of quality freshers
 
neiljaysonching
neiljaysonchingneiljaysonching
neiljaysonching
Jlien Ching
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
aeden_brines
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
olracoatalub
 
Decision Making and Looping
Decision Making and LoopingDecision Making and Looping
Decision Making and Looping
Munazza-Mah-Jabeen
 
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) [Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
Johnny Sung
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
Rumman Ansari
 
04-Looping( For , while and do while looping) .pdf
04-Looping( For , while and do while looping) .pdf04-Looping( For , while and do while looping) .pdf
04-Looping( For , while and do while looping) .pdf
nithishkumar2867
 
Enabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive EnvironmentsEnabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive Environments
C4Media
 
Switch case and looping kim
Switch case and looping kimSwitch case and looping kim
Switch case and looping kim
kimberly_Bm10203
 
How to write c programme
How to write c programmeHow to write c programme
How to write c programme
Sourav Ganguly
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
Kiwamu Okabe
 
decision making in c.pptx
decision making in c.pptxdecision making in c.pptx
decision making in c.pptx
DrGAMBIKA
 
Brand New JavaScript - ECMAScript 2015
Brand New JavaScript - ECMAScript 2015Brand New JavaScript - ECMAScript 2015
Brand New JavaScript - ECMAScript 2015
Gil Fink
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Rebecca Eloise Hogg
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
ChaAstillas
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
aeden_brines
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
olracoatalub
 
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) [Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
Johnny Sung
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
Rumman Ansari
 
04-Looping( For , while and do while looping) .pdf
04-Looping( For , while and do while looping) .pdf04-Looping( For , while and do while looping) .pdf
04-Looping( For , while and do while looping) .pdf
nithishkumar2867
 
Enabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive EnvironmentsEnabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive Environments
C4Media
 
Switch case and looping kim
Switch case and looping kimSwitch case and looping kim
Switch case and looping kim
kimberly_Bm10203
 
Ad

Recently uploaded (20)

Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptxRai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 

C program language tutorial for loop while loop do while loop

  • 1. C language Loop Control (for , while , do while) Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 2. Sourav Ganguly Please visit my Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 3. for loop of C language….. Different types of for loop in C language….. for loop example with real program….. [Live Demo on YouTube channel] while loop of C language….. Different types of while loop in C language….. while loop example with real program….. [Live Demo on YouTube channel] do while loop of C language….. Different types of do while loop in C language….. do while loop example with real program….. [Live Demo on YouTube channel] Index Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 4. for loop of C language….. for ( initialization ; condition(TRUE / FALSE) ; increment / decrement ) { Task / Job; } int x; for ( x=0 ; x < 3 ; x=x+1 ) { printf(“%d”,x); printf(“n”); } printf(“Loop end”); Output: 0 1 2 Loop end Copyright © 2015 · Sourav Ganguly · All Rights Reserved. 6 1 2 3 4 5
  • 5. for ( initialization ; condition(TRUE / FALSE) ; increment / decrement ) { for ( init ; con(TRUE / FALSE) ; inc / dec ) { Task / Job; } } Copyright © 2015 · Sourav Ganguly · All Rights Reserved. 12 1 2 3 4 11 5 6 7 8 9 10 nested for loop of C language…..
  • 6. int loop1,loop2; for ( loop1=0 ; loop1 < 3 ; loop1=loop1+1 ) { for ( loop2=0 ; loop2 < 3 ; loop2=loop2+1 ) { printf(“%d”,loop2); } printf(“n”); printf(“Loop2 end”); printf(“n”); } printf(“Loop1 end”); Output: 012 Loop2 end 012 Loop2 end 012 Loop2 end Loop1 end Copyright © 2015 · Sourav Ganguly · All Rights Reserved. nested for loop of C language….. example
  • 7. initialization ; while (condition(TRUE / FALSE) ) { Task / Job; increment / decrement ; } int x=0; while ( x < 3 ) { printf(“n%d”,x); x=x+1; } printf(“Loop end”); Output: 0 1 2 Loop end Copyright © 2015 · Sourav Ganguly · All Rights Reserved. 5 1 2 3 4 while loop of C language…..
  • 8. initialization ; while (condition(TRUE / FALSE) ) { init ; while (con(TRUE / FALSE)) { Task / Job; inc / dec ; } increment / decrement ; } Copyright © 2015 · Sourav Ganguly · All Rights Reserved. 1 2 3 4 9 5 6 7 8 10 nested while loop of C language…..
  • 9. int loop1,loop2; loop1=0 ; while (loop1 < 3) { loop2=0 ; while (loop2 < 3) { printf(“%d”,loop2); loop2=loop2+1; } printf(“n”); printf(“Loop2 end”); loop1=loop1+1; } printf(“Loop1 end”); Output: 012 Loop2 end 012 Loop2 end 012 Loop2 end Loop1 end Copyright © 2015 · Sourav Ganguly · All Rights Reserved. nested while loop of C language….. example
  • 10. initialization ; do { Task / Job; increment / decrement ; } while (condition(TRUE / FALSE) ) ; int x=0; do { printf(“n%d”,x); x=x+1; } while( x < 3 ); printf(“Loop end”); Output: 0 1 2 Loop end Copyright © 2015 · Sourav Ganguly · All Rights Reserved. 6 1 2 4 5 do while loop of C language….. 3
  • 11. initialization ; do { init ; do { Task / Job; inc / dec ; } while (con(TRUE / FALSE)) increment / decrement ; } while (condition(TRUE / FALSE) ) Copyright © 2015 · Sourav Ganguly · All Rights Reserved. 1 2 3 4 11 5 6 7 8 12 nested do while loop of C language….. 10 9
  • 12. int loop1,loop2; loop1=0 ; do { loop2=0 ; do { printf(“%d”,loop2); loop2=loop2+1; } while (loop2 < 3) ; printf(“n”); printf(“Loop2 end”); loop1=loop1+1; } while (loop1 < 3); printf(“Loop1 end”); Output: 012 Loop2 end 012 Loop2 end 012 Loop2 end Loop1 end Copyright © 2015 · Sourav Ganguly · All Rights Reserved. nested do while loop of C language….. example
  • 13. Sourav Ganguly Please visit my Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.