Download presentation
Presentation is loading. Please wait.
1
Visual Basic – Decision Statements
2
If Blocks An If block allows a program to decide on a course of action based on whether a certain condition is True or False
3
Syntax If condition Then action1 Else ‘* Else is optional action2 End If
4
Sample Code Write a program to find the larger of two numbers input by the user:
5
Code for Decision
6
Nested Ifs (Compound Ifs)
An If statement within an If Statement More than one option Find the smallest of 3 numbers
7
Syntax If condition Then action1 Else If condition2 then action2 Else action3 End If
8
Code for Nested Decision
Compound Condition – Logical Oper.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.