SlideShare a Scribd company logo
Made By:
Neel Pradip Shah (13CP612)
(130110107048)
1
There are some situations where one may
have to
 Change the order of execution based on
certain conditions
OR
 Repeat a group of statements until certain
conditions are satisfied.
2
For this, C supports some statements which are
capable of decision making, they are:
1. If statement
2. Switch statement
3. Conditional Operator
4. Goto Statement
5. While loop
6. Do-While loop
7. For loop
3
Syntax
if(test expression)
{
statement
Block;
}
statement X;
Test
expression
?
Statement - block
Statement - X
Next Statement
TRUE
FALSE
ENTRY
4
Syntax
if(test expression)
{
statement
Block(true);
}
else
{
statement
Block(false);
}
statement X;
Test
expression
?
Statement - block
Statement - X
TRUE
ENTRY
Statement - block
FALSE
5
Syntax
switch(expression)
{
case value-1:
block-1;
break;
case value-2:
block-2;
break;
……………..
……………..
default
block;
break;
}
Statement - X 6
 It is used for an unconditional jump
Syntax
(forward jump) (backward jump)
goto label; label:
…………….. Statement;
…………….. ………………
Label: ………………
Statement; goto label;
 Programmers avoid using this
 As this statement makes logic complicated and
debugging is difficult.
7
 An Entry Controlled loop
 Syntax
while(test condition)
{
Body Of the Loop
}
8
 An Exit Controlled loop
 Syntax
do
{
set of statements
}
while(condition);
9
 An Entry Controlled Loop
 Syntax
for(initialization ; test-condition ; increment)
{
BODY OF THE LOOP
}
10
for(initialization ; test-condition ; increment)
{
BODY OF THE LOOP
}
11
Entry
True
False
Entry
False
True
Test
Condition
Test
Condition
Body of
The loop
Body of
The loop
12
a=10; for(a=10; a!=0; a--)a=10; for(a=10; a!=0; a--)
while(a != 0)while(a != 0) {{
{ printf(“%d”,a);{ printf(“%d”,a);
}}
printf(“%d”,a);printf(“%d”,a);
a--;a--;
}}
a=10;a=10;
dodo
{ OUTPUT : 10987654321{ OUTPUT : 10987654321
Printf(“%d”,a);Printf(“%d”,a);
a--;a--;
}}
while(a!=0)while(a!=0)
13
 ANSI C By E.Balagurusamy
 Programming With C By Byron S Gottfried
14
15

More Related Content

PPTX
Control statement-Selective
Nurul Zakiah Zamri Tan
 
PPSX
Type conversion
Frijo Francis
 
PDF
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
PPTX
Control statements in c
Sathish Narayanan
 
PPTX
Looping statement
ilakkiya
 
PPTX
Variables, Data Types, Operator & Expression in c in detail
gourav kottawar
 
PPTX
Control and conditional statements
rajshreemuthiah
 
PPTX
Decision making and branching in c programming
Priyansh Thakar
 
Control statement-Selective
Nurul Zakiah Zamri Tan
 
Type conversion
Frijo Francis
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Control statements in c
Sathish Narayanan
 
Looping statement
ilakkiya
 
Variables, Data Types, Operator & Expression in c in detail
gourav kottawar
 
Control and conditional statements
rajshreemuthiah
 
Decision making and branching in c programming
Priyansh Thakar
 

What's hot (20)

PPTX
Recursive Function
Kamal Acharya
 
PPTX
Looping statements in C
Jeya Lakshmi
 
PPTX
Functions in Python
Shakti Singh Rathore
 
PPT
Relational Algebra.ppt
Sreenivas R
 
PPTX
Friend function
zindadili
 
PPTX
Recursion with Python [Rev]
Dennis Walangadi
 
PDF
itft-Decision making and branching in java
Atul Sehdev
 
PPTX
Variables in C++, data types in c++
Neeru Mittal
 
PPTX
C Programming: Control Structure
Sokngim Sa
 
PPTX
Loops in c language
tanmaymodi4
 
PDF
Python Programming - Files & Exceptions
Omid AmirGhiasvand
 
PDF
10. switch case
Way2itech
 
PPTX
PHP slides
Farzad Wadia
 
PPSX
Exception Handling
Reddhi Basu
 
PDF
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
PPT
Branching in C
Prabhu Govind
 
PPT
friend function(c++)
Ritika Sharma
 
PPTX
php Fundamentos
Alexys González
 
PPSX
Complete C++ programming Language Course
Vivek Singh Chandel
 
Recursive Function
Kamal Acharya
 
Looping statements in C
Jeya Lakshmi
 
Functions in Python
Shakti Singh Rathore
 
Relational Algebra.ppt
Sreenivas R
 
Friend function
zindadili
 
Recursion with Python [Rev]
Dennis Walangadi
 
itft-Decision making and branching in java
Atul Sehdev
 
Variables in C++, data types in c++
Neeru Mittal
 
C Programming: Control Structure
Sokngim Sa
 
Loops in c language
tanmaymodi4
 
Python Programming - Files & Exceptions
Omid AmirGhiasvand
 
10. switch case
Way2itech
 
PHP slides
Farzad Wadia
 
Exception Handling
Reddhi Basu
 
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Branching in C
Prabhu Govind
 
friend function(c++)
Ritika Sharma
 
php Fundamentos
Alexys González
 
Complete C++ programming Language Course
Vivek Singh Chandel
 
Ad

Viewers also liked (20)

PPT
Control structure
Samsil Arefin
 
PPT
Control Structures
Ghaffar Khan
 
PPTX
control structures in c if switch for
gourav kottawar
 
PPTX
handling input output and control statements
Rai University
 
PPT
Unit1 C
arnold 7490
 
PPTX
C LANGUAGE - BESTECH SOLUTIONS
BESTECH SOLUTIONS
 
DOCX
FUNCIONES EN LENGUAJE C
flaquita_dany
 
PPSX
Control Structures in Visual Basic
Tushar Jain
 
PPTX
Array in C
Kamal Acharya
 
DOCX
Librerias en-lenguaje-c
Kevin2811
 
PPT
Funciones en C
Ronny Parra
 
PPT
Arrays
archikabhatia
 
PPTX
Array in c language
home
 
PPSX
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
PDF
Control structures in Java
Ravi_Kant_Sahu
 
PDF
Control statements
Kanwalpreet Kaur
 
PDF
Lecture18 structurein c.ppt
eShikshak
 
Control structure
Samsil Arefin
 
Control Structures
Ghaffar Khan
 
control structures in c if switch for
gourav kottawar
 
handling input output and control statements
Rai University
 
Unit1 C
arnold 7490
 
C LANGUAGE - BESTECH SOLUTIONS
BESTECH SOLUTIONS
 
FUNCIONES EN LENGUAJE C
flaquita_dany
 
Control Structures in Visual Basic
Tushar Jain
 
Array in C
Kamal Acharya
 
Librerias en-lenguaje-c
Kevin2811
 
Funciones en C
Ronny Parra
 
Array in c language
home
 
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
Control structures in Java
Ravi_Kant_Sahu
 
Control statements
Kanwalpreet Kaur
 
Lecture18 structurein c.ppt
eShikshak
 
Ad

Similar to Control Structure in C (20)

PPTX
Decision Making Statement in C ppt
MANJUTRIPATHI7
 
PPTX
Std 12 computer java basics part 3 control structure
Nuzhat Memon
 
DOCX
Lecture 26.07.2014
vishal choudhary
 
PPTX
lecture 6 bca 1 year-1.pptx
classall
 
PPT
control-statements, control-statements, control statement
crrpavankumar
 
PPT
control-statements detailed presentation
gayathripcs
 
DOCX
Loops and iteration.docx
NkurikiyimanaGodefre
 
PPT
Decision Making and Branching in C
RAJ KUMAR
 
PDF
Unit 2=Decision Control & Looping Statements.pdf
Dr. Ambedkar Institute of Technology, Bangalore 56
 
PPTX
Bansal presentation (1).pptx
AbhiYadav655132
 
PPT
2. Control structures with for while and do while.ppt
ManojKhadilkar1
 
PPTX
CONTROL STMTS.pptx
JavvajiVenkat
 
PPTX
Decision control structures
Rahul Bathri
 
PPT
control-statements....ppt - definition
Papitha7
 
PPT
_Java__Expressions__and__FlowControl.ppt
JyothiAmpally
 
PPT
_Java__Expressions__and__FlowControl.ppt
JyothiAmpally
 
PPT
C Programming Notes and Importaint Topics
SoumyaKantiSarkar2
 
PPT
Control structure and Looping statements
BalaKrishnan466
 
PPT
lecture about visual basic studio 6.0 presentation
GayathriShiva4
 
PPTX
Control Statement programming
University of Potsdam
 
Decision Making Statement in C ppt
MANJUTRIPATHI7
 
Std 12 computer java basics part 3 control structure
Nuzhat Memon
 
Lecture 26.07.2014
vishal choudhary
 
lecture 6 bca 1 year-1.pptx
classall
 
control-statements, control-statements, control statement
crrpavankumar
 
control-statements detailed presentation
gayathripcs
 
Loops and iteration.docx
NkurikiyimanaGodefre
 
Decision Making and Branching in C
RAJ KUMAR
 
Unit 2=Decision Control & Looping Statements.pdf
Dr. Ambedkar Institute of Technology, Bangalore 56
 
Bansal presentation (1).pptx
AbhiYadav655132
 
2. Control structures with for while and do while.ppt
ManojKhadilkar1
 
CONTROL STMTS.pptx
JavvajiVenkat
 
Decision control structures
Rahul Bathri
 
control-statements....ppt - definition
Papitha7
 
_Java__Expressions__and__FlowControl.ppt
JyothiAmpally
 
_Java__Expressions__and__FlowControl.ppt
JyothiAmpally
 
C Programming Notes and Importaint Topics
SoumyaKantiSarkar2
 
Control structure and Looping statements
BalaKrishnan466
 
lecture about visual basic studio 6.0 presentation
GayathriShiva4
 
Control Statement programming
University of Potsdam
 

Recently uploaded (20)

PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Basics and rules of probability with real-life uses
ravatkaran694
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
Virus sequence retrieval from NCBI database
yamunaK13
 

Control Structure in C