SlideShare a Scribd company logo
1 of 13
Presentation
on
Different loops in C
1
Dhaka International University
Dhaka International University
Presented By-
Md. Arif Hossain
Department of EETE (Evening)
Batch- 31st
Roll No- 33
Reg. No- EE-E-15-31-101055
2
Content
 What is Programming?
 What is Structured Programming?
 What is Loops?
 Sample program using for, while & do/while loops
Dhaka International University
3
What is programming?
 Programming is the technique way to accomplish a task or to
solve a problem by using program.
What is Structured programming?
 Structured programming (sometimes known as modular
Programming) is a subset of procedural programming that
enforces a logical structure on the program being written to
make it more efficient and easier to understand and modify.
Structured programming works as modules.
Dhaka International University
4
What is Loops?
 In C and all other Programming languages, loops allow a set
of instructions to be performed until a certain condition is
reached. This condition may be predefined as in the for loop, or
open-ended as in the while and do loops.
Dhaka International University
5
For loops (initialization; condition; increment) statement
 An important point about for loop is that the conditional test is always
Performed at the top of the loop
//A Program for a Inverted Pyramid using for loop
#include<stdio.h>
#include<conio.h>
void main ()
{
int i, j;
clrscr();
for (i=0; i<5; i++)
{
for(j=i; j<=4;j++)
printf("*");
printf("n");
getch();
}
6
Dhaka International University
Output:
************
*
7
**
while loops (condition) statement
 for & while loops performs in the same way that means while loops
check the test condition at the top of the loop. for & while loops is called
entry controlled loops.
//A Program using while loop
#include<stdio.h>
#include<conio.h>
void main ()
{
int i=0;
clrscr();
while (i<2)
{
printf("Done Before?n");
i++;
}
printf ("Not Sure!");
getch();
}
8
Dhaka International University
Output:
Done Before?
Done Before??
Not Sure!
9
do/while loops do{
Statement sequence;
}
while(condition);
 for & do/while loops checks its condition at the bottom of the loop. Its
called exit controlled loops.
//A Program using do/while loop
#include<stdio.h>
#include<conio.h>
void main ()
{
int i=0;
clrscr();
do
{
printf("Done Before?n");
i++;
}
While (i<2);
printf ("Not Sure!");
getch();
}
10
Dhaka International University
Output:
Done Before?
Done Before??
Done Before???
Not Sure!
11
Dhaka International University
12
Dhaka International University
13

More Related Content

What's hot (20)

The Loops
The LoopsThe Loops
The Loops
 
CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
Decision making and branching in c programming
Decision making and branching in c programmingDecision making and branching in c programming
Decision making and branching in c programming
 
Forloop
ForloopForloop
Forloop
 
Loops in C
Loops in CLoops in C
Loops in C
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Loops c++
Loops c++Loops c++
Loops c++
 
Loops Basics
Loops BasicsLoops Basics
Loops Basics
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in C
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
C if else
C if elseC if else
C if else
 
Break and continue
Break and continueBreak and continue
Break and continue
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
Presentation on C Switch Case Statements
Presentation on C Switch Case StatementsPresentation on C Switch Case Statements
Presentation on C Switch Case Statements
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
Input and output in C++
Input and output in C++Input and output in C++
Input and output in C++
 
C functions
C functionsC functions
C functions
 
Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Loops in c++ programming language
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 

Similar to Different loops in C

Question Pattern in Structure Programming
Question Pattern in Structure ProgrammingQuestion Pattern in Structure Programming
Question Pattern in Structure ProgrammingSuman Mia
 
etlplooping-170320213203.pptx
etlplooping-170320213203.pptxetlplooping-170320213203.pptx
etlplooping-170320213203.pptxffyuyufyfufufufu
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chapthuhiendtk4
 
decision making in c.pptx
decision making in c.pptxdecision making in c.pptx
decision making in c.pptxDrGAMBIKA
 
C_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.pptC_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.pptganeshkarthy
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diarySHARDA SHARAN
 
65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdf65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdfAhmedEmadElGhetany
 
APP_Unit 1_updated.pptx
APP_Unit 1_updated.pptxAPP_Unit 1_updated.pptx
APP_Unit 1_updated.pptxgogulram2
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshareGagan Deep
 
Object oriented programming system with C++
Object oriented programming system with C++Object oriented programming system with C++
Object oriented programming system with C++msharshitha03s
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaDwight Sabio
 

Similar to Different loops in C (20)

Loops in C.pptx
Loops in C.pptxLoops in C.pptx
Loops in C.pptx
 
Question Pattern in Structure Programming
Question Pattern in Structure ProgrammingQuestion Pattern in Structure Programming
Question Pattern in Structure Programming
 
Loops in c
Loops in cLoops in c
Loops in c
 
etlplooping-170320213203.pptx
etlplooping-170320213203.pptxetlplooping-170320213203.pptx
etlplooping-170320213203.pptx
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chap
 
decision making in c.pptx
decision making in c.pptxdecision making in c.pptx
decision making in c.pptx
 
PHP slides
PHP slidesPHP slides
PHP slides
 
C_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.pptC_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.ppt
 
Ch3 repetition
Ch3 repetitionCh3 repetition
Ch3 repetition
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
Programming in C
Programming in CProgramming in C
Programming in C
 
65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdf65_96195_CC112_2014_1__1_1_week1.pdf
65_96195_CC112_2014_1__1_1_week1.pdf
 
Decision Making and Looping
Decision Making and LoopingDecision Making and Looping
Decision Making and Looping
 
9. control statement
9. control statement9. control statement
9. control statement
 
APP_Unit 1_updated.pptx
APP_Unit 1_updated.pptxAPP_Unit 1_updated.pptx
APP_Unit 1_updated.pptx
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshare
 
Object oriented programming system with C++
Object oriented programming system with C++Object oriented programming system with C++
Object oriented programming system with C++
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Compiler design
Compiler designCompiler design
Compiler design
 

More from Md. Arif Hossain

Avada Brochure and Reviewing
Avada Brochure and ReviewingAvada Brochure and Reviewing
Avada Brochure and ReviewingMd. Arif Hossain
 
Real Life Problems and it’s Solution by technology
Real Life Problems  and it’s Solution by technologyReal Life Problems  and it’s Solution by technology
Real Life Problems and it’s Solution by technologyMd. Arif Hossain
 
INTEL 8086 MP Architecture
INTEL 8086 MP ArchitectureINTEL 8086 MP Architecture
INTEL 8086 MP ArchitectureMd. Arif Hossain
 
Introduction to Digital Signal Processing (DSP)
Introduction  to  Digital Signal Processing (DSP)Introduction  to  Digital Signal Processing (DSP)
Introduction to Digital Signal Processing (DSP)Md. Arif Hossain
 
Introduction to Instrument and Measurement Device
Introduction  to  Instrument and Measurement DeviceIntroduction  to  Instrument and Measurement Device
Introduction to Instrument and Measurement DeviceMd. Arif Hossain
 

More from Md. Arif Hossain (7)

Avada Brochure and Reviewing
Avada Brochure and ReviewingAvada Brochure and Reviewing
Avada Brochure and Reviewing
 
Light Detector
Light Detector Light Detector
Light Detector
 
Real Life Problems and it’s Solution by technology
Real Life Problems  and it’s Solution by technologyReal Life Problems  and it’s Solution by technology
Real Life Problems and it’s Solution by technology
 
INTEL 8086 MP Architecture
INTEL 8086 MP ArchitectureINTEL 8086 MP Architecture
INTEL 8086 MP Architecture
 
Introduction to Digital Signal Processing (DSP)
Introduction  to  Digital Signal Processing (DSP)Introduction  to  Digital Signal Processing (DSP)
Introduction to Digital Signal Processing (DSP)
 
Introduction to Instrument and Measurement Device
Introduction  to  Instrument and Measurement DeviceIntroduction  to  Instrument and Measurement Device
Introduction to Instrument and Measurement Device
 
VoIP
VoIPVoIP
VoIP
 

Recently uploaded

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 

Different loops in C

  • 1. Presentation on Different loops in C 1 Dhaka International University
  • 2. Dhaka International University Presented By- Md. Arif Hossain Department of EETE (Evening) Batch- 31st Roll No- 33 Reg. No- EE-E-15-31-101055 2
  • 3. Content  What is Programming?  What is Structured Programming?  What is Loops?  Sample program using for, while & do/while loops Dhaka International University 3
  • 4. What is programming?  Programming is the technique way to accomplish a task or to solve a problem by using program. What is Structured programming?  Structured programming (sometimes known as modular Programming) is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. Structured programming works as modules. Dhaka International University 4
  • 5. What is Loops?  In C and all other Programming languages, loops allow a set of instructions to be performed until a certain condition is reached. This condition may be predefined as in the for loop, or open-ended as in the while and do loops. Dhaka International University 5
  • 6. For loops (initialization; condition; increment) statement  An important point about for loop is that the conditional test is always Performed at the top of the loop //A Program for a Inverted Pyramid using for loop #include<stdio.h> #include<conio.h> void main () { int i, j; clrscr(); for (i=0; i<5; i++) { for(j=i; j<=4;j++) printf("*"); printf("n"); getch(); } 6
  • 8. while loops (condition) statement  for & while loops performs in the same way that means while loops check the test condition at the top of the loop. for & while loops is called entry controlled loops. //A Program using while loop #include<stdio.h> #include<conio.h> void main () { int i=0; clrscr(); while (i<2) { printf("Done Before?n"); i++; } printf ("Not Sure!"); getch(); } 8
  • 9. Dhaka International University Output: Done Before? Done Before?? Not Sure! 9
  • 10. do/while loops do{ Statement sequence; } while(condition);  for & do/while loops checks its condition at the bottom of the loop. Its called exit controlled loops. //A Program using do/while loop #include<stdio.h> #include<conio.h> void main () { int i=0; clrscr(); do { printf("Done Before?n"); i++; } While (i<2); printf ("Not Sure!"); getch(); } 10
  • 11. Dhaka International University Output: Done Before? Done Before?? Done Before??? Not Sure! 11

Editor's Notes

  1. Variant control, when exit, repeated control
  2. Variant control, when exit, repeated control
  3. Variant control, when exit, repeated control