SlideShare a Scribd company logo
Learning C Programming
With
Dr. Gopika S
Kristu Jayanti College
CONTROL STATEMENTS/DECISION MAKING
Decision making structures require that the programmer specifies one or more
conditions to be evaluated or tested by the program, along with a statement or
statements to be executed if the condition is determined to be true, and optionally,
other statements to be executed if the condition is determined to be false.
There are the following variants of if statement in C language.
•If statement
•If-else statement
•If else-if ladder
•Nested if
IF STATEMENT
The if statement is used to check some given condition and perform some operations
depending upon the correctness of that condition.
It is mostly used in the scenario where we need to perform the different operations
for the different conditions.
The syntax
if(expression){
//code to be executed
}
FLOW DIAGRAM
Conditional control statements explains the programming constructs
IF-ELSE STATEMENT
•The if-else statement is used to perform two operations for a single condition.
•The if-else statement is an extension to the if statement using which, we can perform
two different operations, i.e., one is for the correctness of that condition, and the other
is for the incorrectness of the condition.
The syntax of the if-else statement is given below.
if(expression){
//code to be executed if condition is true
}else{
//code to be executed if condition is false
}
Conditional control statements explains the programming constructs
IF ELSE-IF LADDER STATEMENT
The if-else-if ladder statement is an extension to the if-else statement.
 It is used in the scenario where there are multiple cases to be performed for
different conditions.
In if-else-if ladder statement, if a condition is true then the statements defined in the
if block will be executed, otherwise if some other condition is true then the statements
defined in the else-if block will be executed, at the last if none of the condition is true
then the statements defined in the else block will be executed.
Conditional control statements explains the programming constructs
Conditional control statements explains the programming constructs
SWITCH STATEMENT
•The switch statement in C is an alternate to if-else-if ladder statement which allows us
to execute multiple operations for the different possibles values of a single variable
called switch variable.
•Here, We can define various statements in the multiple cases for the different values
of a single variable.
Conditional control statements explains the programming constructs
Conditional control statements explains the programming constructs

More Related Content

PPTX
DECISION MAKING.pptx
PPTX
Decision control structures
PPTX
C Programming: Control Statements in C Pgm
PPTX
Unit-2 control Structures.pptx.pptx20201
PPTX
Computer programming 2 Lesson 9
PPTX
Computer programming 2 - Lesson 7
PPTX
Cse lecture-6-c control statement
PPTX
Java Control Statement Control Statement.pptx
DECISION MAKING.pptx
Decision control structures
C Programming: Control Statements in C Pgm
Unit-2 control Structures.pptx.pptx20201
Computer programming 2 Lesson 9
Computer programming 2 - Lesson 7
Cse lecture-6-c control statement
Java Control Statement Control Statement.pptx

Similar to Conditional control statements explains the programming constructs (20)

PDF
Computer Programming 1 Computer programmingComputer programmingComputer progr...
PPT
control-statements detailed presentation
PPTX
Control Statement programming
PPT
If-else and switch-case
PDF
itft-Decision making and branching in java
PDF
Learn C# Programming - Decision Making & Loops
PPTX
If else statement 05 (js)
DOCX
Chapter 4(1)
PPTX
Control statements in java
PPTX
PDF
Java -lec-4
PPTX
Flow of control C ++ By TANUJ
PPTX
control-statements in C Language MH.pptx
PPT
Cprogrammingprogramcontrols
PPTX
DECISION MAKING AND BRANCHING - C Programming
PPTX
Introduction to Conditional Statements.pptx
DOCX
Data type
PPTX
Java provides statements that can be used to control the flow of Java code
PPT
Control statements
PPT
_Java__Expressions__and__FlowControl.ppt
Computer Programming 1 Computer programmingComputer programmingComputer progr...
control-statements detailed presentation
Control Statement programming
If-else and switch-case
itft-Decision making and branching in java
Learn C# Programming - Decision Making & Loops
If else statement 05 (js)
Chapter 4(1)
Control statements in java
Java -lec-4
Flow of control C ++ By TANUJ
control-statements in C Language MH.pptx
Cprogrammingprogramcontrols
DECISION MAKING AND BRANCHING - C Programming
Introduction to Conditional Statements.pptx
Data type
Java provides statements that can be used to control the flow of Java code
Control statements
_Java__Expressions__and__FlowControl.ppt
Ad

More from GopikaS12 (10)

PPTX
History and Introduction to LINUX .pptx
PPTX
Memory management concepts in operating system
PPTX
Deadlock _Classic problems.pptx
PPTX
Introduction to Tree .pptx
PPTX
C Programming language - introduction
PPTX
C formatted and unformatted input and output constructs
PPTX
Heap creation from elements - Step by step Approach
PPTX
Data Structures: Stack Operations
PPT
Net content in computer architecture
PPTX
It unit 1
History and Introduction to LINUX .pptx
Memory management concepts in operating system
Deadlock _Classic problems.pptx
Introduction to Tree .pptx
C Programming language - introduction
C formatted and unformatted input and output constructs
Heap creation from elements - Step by step Approach
Data Structures: Stack Operations
Net content in computer architecture
It unit 1
Ad

Recently uploaded (20)

PPTX
Geodesy 1.pptx...............................................
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT
introduction to datamining and warehousing
PPTX
web development for engineering and engineering
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPT
Mechanical Engineering MATERIALS Selection
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Artificial Intelligence
Geodesy 1.pptx...............................................
Internet of Things (IOT) - A guide to understanding
Model Code of Practice - Construction Work - 21102022 .pdf
OOP with Java - Java Introduction (Basics)
Automation-in-Manufacturing-Chapter-Introduction.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
R24 SURVEYING LAB MANUAL for civil enggi
introduction to datamining and warehousing
web development for engineering and engineering
UNIT 4 Total Quality Management .pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Mechanical Engineering MATERIALS Selection
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
CH1 Production IntroductoryConcepts.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Artificial Intelligence

Conditional control statements explains the programming constructs

  • 1. Learning C Programming With Dr. Gopika S Kristu Jayanti College
  • 3. Decision making structures require that the programmer specifies one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.
  • 4. There are the following variants of if statement in C language. •If statement •If-else statement •If else-if ladder •Nested if
  • 5. IF STATEMENT The if statement is used to check some given condition and perform some operations depending upon the correctness of that condition. It is mostly used in the scenario where we need to perform the different operations for the different conditions. The syntax if(expression){ //code to be executed }
  • 8. IF-ELSE STATEMENT •The if-else statement is used to perform two operations for a single condition. •The if-else statement is an extension to the if statement using which, we can perform two different operations, i.e., one is for the correctness of that condition, and the other is for the incorrectness of the condition.
  • 9. The syntax of the if-else statement is given below. if(expression){ //code to be executed if condition is true }else{ //code to be executed if condition is false }
  • 11. IF ELSE-IF LADDER STATEMENT The if-else-if ladder statement is an extension to the if-else statement.  It is used in the scenario where there are multiple cases to be performed for different conditions. In if-else-if ladder statement, if a condition is true then the statements defined in the if block will be executed, otherwise if some other condition is true then the statements defined in the else-if block will be executed, at the last if none of the condition is true then the statements defined in the else block will be executed.
  • 14. SWITCH STATEMENT •The switch statement in C is an alternate to if-else-if ladder statement which allows us to execute multiple operations for the different possibles values of a single variable called switch variable. •Here, We can define various statements in the multiple cases for the different values of a single variable.