SlideShare a Scribd company logo
1 of 7
Creating Decision
Structures of a
Program
The decision statement is a control
statement which is used to handle the
execution of the parts of a program.
The two basic types of decision
statements are IF statement and Select
Case statement.
If … ThenDecision Structures
The IF…Then decision structures
allow a condition in a program to
be evaluated or take course of
action based on the result .
The decision structure syntax is:
If total >=40 then label1.caption = Old
Use the multiple commands to execute
more
than one command in response to a
condition. This
bounds a range of statements between the If
statement and an End IF statement.
To handle a false conditions, the visual basic
uses the
else part of the If statement block.
Syntax:
if condition then
statements to process
when condition is true
Else
statements to process
when condition is false
End If
Using Multiple IF statements
The else statement lets you
evaluate multiple
conditions. The ElseIf
statement allows you to
specify evaluated condition
when the first is false.
Syntax:
If condition 1 then
statements executed if conditional
is true
Else if condition 2 then
Statements executed if conditional is
true
Else
statements executed if none of the
conditions is true
End if

More Related Content

Similar to Creating decision structures of a program

Chapter 4(1)
Chapter 4(1)Chapter 4(1)
Chapter 4(1)TejaswiB4
 
Flow of control by deepak lakhlan
Flow of control by deepak lakhlanFlow of control by deepak lakhlan
Flow of control by deepak lakhlanDeepak Lakhlan
 
What are conditional statements?
What are conditional statements?What are conditional statements?
What are conditional statements?AnuragSrivastava272
 
Constructs (Programming Methodology)
Constructs (Programming Methodology)Constructs (Programming Methodology)
Constructs (Programming Methodology)Jyoti Bhardwaj
 
Programming (if else)
Programming (if else)Programming (if else)
Programming (if else)Papon Sarker
 
Cse lecture-6-c control statement
Cse lecture-6-c control statementCse lecture-6-c control statement
Cse lecture-6-c control statementFarshidKhan
 
C statements.ppt presentation in c language
C statements.ppt presentation in c languageC statements.ppt presentation in c language
C statements.ppt presentation in c languagechintupro9
 
Decision making and looping - c programming by YEASIN NEWAJ
Decision making and looping -  c programming by YEASIN NEWAJDecision making and looping -  c programming by YEASIN NEWAJ
Decision making and looping - c programming by YEASIN NEWAJYeasinNewaj
 
Decision control structures
Decision control structuresDecision control structures
Decision control structuresRahul Bathri
 
Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Syed Farjad Zia Zaidi
 
Unit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptxUnit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptxUjwala Junghare
 

Similar to Creating decision structures of a program (20)

Chapter 4(1)
Chapter 4(1)Chapter 4(1)
Chapter 4(1)
 
Flow of control by deepak lakhlan
Flow of control by deepak lakhlanFlow of control by deepak lakhlan
Flow of control by deepak lakhlan
 
Control statements in java
Control statements in javaControl statements in java
Control statements in java
 
What are conditional statements?
What are conditional statements?What are conditional statements?
What are conditional statements?
 
Constructs (Programming Methodology)
Constructs (Programming Methodology)Constructs (Programming Methodology)
Constructs (Programming Methodology)
 
Programming (if else)
Programming (if else)Programming (if else)
Programming (if else)
 
Cse lecture-6-c control statement
Cse lecture-6-c control statementCse lecture-6-c control statement
Cse lecture-6-c control statement
 
C sharp chap4
C sharp chap4C sharp chap4
C sharp chap4
 
C statements.ppt presentation in c language
C statements.ppt presentation in c languageC statements.ppt presentation in c language
C statements.ppt presentation in c language
 
If-else and switch-case
If-else and switch-caseIf-else and switch-case
If-else and switch-case
 
Decision making and looping - c programming by YEASIN NEWAJ
Decision making and looping -  c programming by YEASIN NEWAJDecision making and looping -  c programming by YEASIN NEWAJ
Decision making and looping - c programming by YEASIN NEWAJ
 
Python decision making
Python   decision makingPython   decision making
Python decision making
 
If else statement 05 (js)
If else statement 05 (js)If else statement 05 (js)
If else statement 05 (js)
 
Ch04
Ch04Ch04
Ch04
 
Decision control structures
Decision control structuresDecision control structures
Decision control structures
 
Decisions
DecisionsDecisions
Decisions
 
Decisions
DecisionsDecisions
Decisions
 
Decisions
DecisionsDecisions
Decisions
 
Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2
 
Unit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptxUnit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptx
 

Creating decision structures of a program

  • 2. The decision statement is a control statement which is used to handle the execution of the parts of a program. The two basic types of decision statements are IF statement and Select Case statement.
  • 3. If … ThenDecision Structures The IF…Then decision structures allow a condition in a program to be evaluated or take course of action based on the result . The decision structure syntax is: If total >=40 then label1.caption = Old
  • 4. Use the multiple commands to execute more than one command in response to a condition. This bounds a range of statements between the If statement and an End IF statement. To handle a false conditions, the visual basic uses the else part of the If statement block.
  • 5. Syntax: if condition then statements to process when condition is true Else statements to process when condition is false End If
  • 6. Using Multiple IF statements The else statement lets you evaluate multiple conditions. The ElseIf statement allows you to specify evaluated condition when the first is false.
  • 7. Syntax: If condition 1 then statements executed if conditional is true Else if condition 2 then Statements executed if conditional is true Else statements executed if none of the conditions is true End if