SlideShare a Scribd company logo
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

PPTX
Loops in c programming
PPTX
Loops in C Programming
PPTX
Loops Basics
PPT
RECURSION IN C
PPTX
Loops in c language
PPTX
Loops in c
Loops in c programming
Loops in C Programming
Loops Basics
RECURSION IN C
Loops in c language
Loops in c

What's hot (20)

PPTX
Looping statements in C
PPTX
Decision making statements in C programming
PPTX
Loops in C Programming Language
PDF
Looping in c language
PPTX
PPTX
Types of loops in c language
PPTX
While loop,Do While loop ,for loop
PPTX
Loop(for, while, do while) condition Presentation
PPTX
Decision Making and Looping
PPTX
Conditional statement c++
PPT
Input and output in C++
PPTX
JAVA LOOP.pptx
PPTX
If statements in c programming
PPTX
C Programming: Control Structure
PPTX
Looping statement
PPTX
Unit 3. Input and Output
PPTX
arrays and pointers
PPTX
Variables in C++, data types in c++
PPTX
Decision Making Statement in C ppt
PPTX
Input and Output In C Language
Looping statements in C
Decision making statements in C programming
Loops in C Programming Language
Looping in c language
Types of loops in c language
While loop,Do While loop ,for loop
Loop(for, while, do while) condition Presentation
Decision Making and Looping
Conditional statement c++
Input and output in C++
JAVA LOOP.pptx
If statements in c programming
C Programming: Control Structure
Looping statement
Unit 3. Input and Output
arrays and pointers
Variables in C++, data types in c++
Decision Making Statement in C ppt
Input and Output In C Language
Ad

Similar to Different loops in C (20)

PPTX
Loops in C.pptx
PPTX
C PROGRAMMING-CONTROL STATEMENT (IF-ELSE, SWITCH)
PPTX
Question Pattern in Structure Programming
PPTX
Loops in c
PPTX
etlplooping-170320213203.pptx
PDF
1584503386 1st chap
PPTX
decision making in c.pptx
PPTX
PHP slides
PPT
C++ CH3-P2 using c++ in all other parts.ppt
PPT
C_Language_PS&PC_Notes.ppt
PPT
Ch3 repetition
PDF
Password protected diary
PPTX
C Programming Unit-2
PPTX
Programming in C
PDF
65_96195_CC112_2014_1__1_1_week1.pdf
PDF
LOOP STATEMENTS AND TYPES OF LOOP IN C LANGUAGE BY RIZWAN
PPTX
9. control statement
PPTX
APP_Unit 1_updated.pptx
PPSX
C lecture 3 control statements slideshare
PPTX
Object oriented programming system with C++
Loops in C.pptx
C PROGRAMMING-CONTROL STATEMENT (IF-ELSE, SWITCH)
Question Pattern in Structure Programming
Loops in c
etlplooping-170320213203.pptx
1584503386 1st chap
decision making in c.pptx
PHP slides
C++ CH3-P2 using c++ in all other parts.ppt
C_Language_PS&PC_Notes.ppt
Ch3 repetition
Password protected diary
C Programming Unit-2
Programming in C
65_96195_CC112_2014_1__1_1_week1.pdf
LOOP STATEMENTS AND TYPES OF LOOP IN C LANGUAGE BY RIZWAN
9. control statement
APP_Unit 1_updated.pptx
C lecture 3 control statements slideshare
Object oriented programming system with C++
Ad

More from Md. Arif Hossain (7)

PDF
Avada Brochure and Reviewing
PPT
Light Detector
PPTX
Real Life Problems and it’s Solution by technology
PPTX
INTEL 8086 MP Architecture
PPTX
Introduction to Digital Signal Processing (DSP)
PPT
Introduction to Instrument and Measurement Device
Avada Brochure and Reviewing
Light Detector
Real Life Problems and it’s Solution by technology
INTEL 8086 MP Architecture
Introduction to Digital Signal Processing (DSP)
Introduction to Instrument and Measurement Device

Recently uploaded (20)

PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Digital Logic Computer Design lecture notes
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPT
Project quality management in manufacturing
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
web development for engineering and engineering
PDF
PPT on Performance Review to get promotions
PPTX
Welding lecture in detail for understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Lecture Notes Electrical Wiring System Components
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Model Code of Practice - Construction Work - 21102022 .pdf
Digital Logic Computer Design lecture notes
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Project quality management in manufacturing
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
web development for engineering and engineering
PPT on Performance Review to get promotions
Welding lecture in detail for understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx

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

  • #7: Variant control, when exit, repeated control
  • #9: Variant control, when exit, repeated control
  • #11: Variant control, when exit, repeated control