Professional Documents
Culture Documents
Conditional Statements in Small Basic
Conditional Statements in Small Basic
STATEMENTS
OBJECTIVES
EXPLAIN CONDITIONAL STATEMENTS
DEMONSTRATE THE TYPES OF CONDITIONAL STATEMENTS
Conditional Statements in Small Basic
If you want the program to perform different functions under different conditions, use conditional statements.
4
If-Then Statement
If-Then statement is the simplest conditional statement in Small Basic.
The words If, Then, and EndIf are reserved words as they have special meaning in Microsoft Small Basic.
The condition is followed by the word Then and the statements to be executed if the condition is true.
Between Then and EndIf, there may be more than one statement.
If-Then-ElseIf statement is used when you need to check a number of conditions in the program.
Its syntax is:
If (condition 1) Then
(Statements to be executed if condition 1 is true )
ElseIf (condition 2) Then
(Statements to be executed if condition 1 is false and
condition 2 is true)
ElseIf (condition 3) Then
(Statements to be executed if condition1 and 2 are false
and condition 3 is true)
Else
(Statements to be executed if all conditions are false)
EndIf
Age = 20
QUIZ
https://quizizz.com/admin/quiz/6264de478fa74b001d9868c4