Page 71 - ModularV1.1 _c7_flipbook
P. 71
Program 1: To demonstrate IF-THEN statement.
IF-THEN-ELSE Statement
The IF-THEN-ELSE statement checks for a condition. If the condition evaluates to true, the indented
statements following the if statement are executed, otherwise the following the else statement are
executed. The syntax of the IF-THEN-ELSE statement is given below:
IF <condition> THEN
Is
Statements to be executed No Yes
condition
ELSE true
Execute Execute
Statements to be executed
commands in commands in
END IF the ELSE block the IF block
Program 2: To check whether the number input by the user is odd or even.
Program 3: To check whether the input number given by the user is greater or smaller than 100.
Conditional and Looping Statements in BASIC-256 69

