際際滷

際際滷Share a Scribd company logo
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
DECISION MAKING.pptx
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
}
DECISION MAKING.pptx
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.
DECISION MAKING.pptx
DECISION MAKING.pptx
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.
DECISION MAKING.pptx
DECISION MAKING.pptx
C LOOPS
The looping can be defined as repeating the same process multiple
times until a specific condition satisfies.
Types of C Loops
There are three types of loops in C language that is given below:
do while
while
for
WHILE LOOP IN C
A while loop in C programming repeatedly executes a target
statement as long as a given condition is true.
Syntax
The syntax of a while loop in C programming language is 
while(condition) {
statement(s);
}
DECISION MAKING.pptx
FOR LOOP IN C
A for loop is a repetition control structure that allows you to
efficiently write a loop that needs to execute a specific number of
times.
Syntax
The syntax of a for loop in C programming language is 
for ( init; condition; increment ) {
statement(s);
}
DECISION MAKING.pptx
DO...WHILE LOOP IN C
Unlike for and while loops, which test the loop condition at the top of
the loop, the do...while loop in C programming checks its condition
at the bottom of the loop.
A do...while loop is similar to a while loop, except the fact that it is
guaranteed to execute at least one time.
The syntax of a do...while loop in C programming language is 
do {
statement(s);
} while( condition );
Notice that the conditional expression appears at the end of the loop,
so the statement(s) in the loop executes once before the condition is
tested.
DECISION MAKING.pptx
C COMMENTS
Comments can be used to explain code, and to make it more
readable. It can also be used to prevent execution when testing
alternative code.
Comments can be singled-lined or multi-lined.
SINGLE-LINE COMMENTS
Single-line comments start with two forward slashes (//).
Any text between // and the end of the line is ignored by the compiler (will
not be executed).
This example uses a single-line comment before a line of code:
Example
// This is a comment
printf("Hello World!");
C MULTI-LINE COMMENTS
Multi-line comments start with /* and ends with */.
Any text between /* and */ will be ignored by the compiler:
Example
/* The code below will print the words Hello World!
to the screen, and it is amazing */
printf("Hello World!");
Ad

Recommended

PPTX
Condition Stmt n Looping stmt.pptx
Likhil181
PPTX
Unit II.pptx
zeenatparveen24
PPTX
Conditional control statements explains the programming constructs
GopikaS12
PPTX
control_structures_c_language_regarding how to represent the loop in language...
ShirishaBuduputi
PPT
2. Control structures with for while and do while.ppt
ManojKhadilkar1
PPT
control-statements....ppt - definition
Papitha7
PDF
Module 2 - Control Structures c programming.pptm.pdf
SudipDebnath20
PPT
control-statements, control-statements, control statement
crrpavankumar
PPTX
C Programming: Control Structure
Sokngim Sa
PPTX
Unit-2 control Structures.pptx.pptx20201
vpenubot
PDF
Controls & Loops in C
Thesis Scientist Private Limited
PDF
Unit 2=Decision Control & Looping Statements.pdf
Dr. Ambedkar Institute of Technology, Bangalore 56
DOC
C operators
srmohan06
PPT
control-statements detailed presentation
gayathripcs
PPTX
Diploma ii cfpc u-3 handling input output and control statements
Rai University
PPTX
computer programming and utilization
JAYDEV PATEL
PPTX
Control structure of c
Komal Kotak
PPTX
Bsc cs pic u-3 handling input output and control statements
Rai University
PPTX
C PROGRAMMING-CONTROL STATEMENT (IF-ELSE, SWITCH)
PallaviGholap4
PDF
Decision Making Statements, Arrays, Strings
Prabu U
PDF
Bt0067 c programming and data structures 1
Techglyphs
PPTX
Mca i pic u-3 handling input output and control statements
Rai University
PPTX
Constructs (Programming Methodology)
Jyoti Bhardwaj
PPTX
Loops
ShivamPatel466
PPTX
Basics of Control Statement in C Languages
Dr. Chandrakant Divate
PPTX
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024

More Related Content

Similar to DECISION MAKING.pptx (20)

PPT
control-statements, control-statements, control statement
crrpavankumar
PPTX
C Programming: Control Structure
Sokngim Sa
PPTX
Unit-2 control Structures.pptx.pptx20201
vpenubot
PDF
Controls & Loops in C
Thesis Scientist Private Limited
PDF
Unit 2=Decision Control & Looping Statements.pdf
Dr. Ambedkar Institute of Technology, Bangalore 56
DOC
C operators
srmohan06
PPT
control-statements detailed presentation
gayathripcs
PPTX
Diploma ii cfpc u-3 handling input output and control statements
Rai University
PPTX
computer programming and utilization
JAYDEV PATEL
PPTX
Control structure of c
Komal Kotak
PPTX
Bsc cs pic u-3 handling input output and control statements
Rai University
PPTX
C PROGRAMMING-CONTROL STATEMENT (IF-ELSE, SWITCH)
PallaviGholap4
PDF
Decision Making Statements, Arrays, Strings
Prabu U
PDF
Bt0067 c programming and data structures 1
Techglyphs
PPTX
Mca i pic u-3 handling input output and control statements
Rai University
PPTX
Constructs (Programming Methodology)
Jyoti Bhardwaj
PPTX
Loops
ShivamPatel466
PPTX
Basics of Control Statement in C Languages
Dr. Chandrakant Divate
control-statements, control-statements, control statement
crrpavankumar
C Programming: Control Structure
Sokngim Sa
Unit-2 control Structures.pptx.pptx20201
vpenubot
Controls & Loops in C
Thesis Scientist Private Limited
Unit 2=Decision Control & Looping Statements.pdf
Dr. Ambedkar Institute of Technology, Bangalore 56
C operators
srmohan06
control-statements detailed presentation
gayathripcs
Diploma ii cfpc u-3 handling input output and control statements
Rai University
computer programming and utilization
JAYDEV PATEL
Control structure of c
Komal Kotak
Bsc cs pic u-3 handling input output and control statements
Rai University
C PROGRAMMING-CONTROL STATEMENT (IF-ELSE, SWITCH)
PallaviGholap4
Decision Making Statements, Arrays, Strings
Prabu U
Bt0067 c programming and data structures 1
Techglyphs
Mca i pic u-3 handling input output and control statements
Rai University
Constructs (Programming Methodology)
Jyoti Bhardwaj
Basics of Control Statement in C Languages
Dr. Chandrakant Divate

Recently uploaded (20)

PPTX
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
PDF
K12 Tableau User Group virtual event June 18, 2025
dogden2
PDF
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
PDF
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
PPTX
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
PDF
Hurricane Helene Application Documents Checklists
Mebane Rash
PPTX
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
PDF
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
PDF
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
PPTX
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
PPTX
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
PDF
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
PDF
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
PDF
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
PDF
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
PDF
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
PPTX
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
PPTX
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
K12 Tableau User Group virtual event June 18, 2025
dogden2
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
Hurricane Helene Application Documents Checklists
Mebane Rash
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
Ad

DECISION MAKING.pptx

  • 2. 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.
  • 3. There are the following variants of if statement in C language. If statement If-else statement If else-if ladder Nested if
  • 4. 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 }
  • 7. 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.
  • 8. 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 }
  • 10. 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.
  • 13. 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.
  • 16. C LOOPS The looping can be defined as repeating the same process multiple times until a specific condition satisfies. Types of C Loops There are three types of loops in C language that is given below: do while while for
  • 17. WHILE LOOP IN C A while loop in C programming repeatedly executes a target statement as long as a given condition is true. Syntax The syntax of a while loop in C programming language is while(condition) { statement(s); }
  • 19. FOR LOOP IN C A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. Syntax The syntax of a for loop in C programming language is for ( init; condition; increment ) { statement(s); }
  • 21. DO...WHILE LOOP IN C Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop. A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time.
  • 22. The syntax of a do...while loop in C programming language is do { statement(s); } while( condition ); Notice that the conditional expression appears at the end of the loop, so the statement(s) in the loop executes once before the condition is tested.
  • 24. C COMMENTS Comments can be used to explain code, and to make it more readable. It can also be used to prevent execution when testing alternative code. Comments can be singled-lined or multi-lined.
  • 25. SINGLE-LINE COMMENTS Single-line comments start with two forward slashes (//). Any text between // and the end of the line is ignored by the compiler (will not be executed). This example uses a single-line comment before a line of code: Example // This is a comment printf("Hello World!");
  • 26. C MULTI-LINE COMMENTS Multi-line comments start with /* and ends with */. Any text between /* and */ will be ignored by the compiler: Example /* The code below will print the words Hello World! to the screen, and it is amazing */ printf("Hello World!");