BASIC Programming/Beginning BASIC/Control Structures/IF...THEN...ELSEIF...ELSE

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

The IF...THEN...ELSEIF...ELSE control statement allows identifing if a certain condition is true, and executes a block of code if it is the case.

IF number<0 THEN
  PRINT "Number is negative"
ELSEIF number>0 THEN
  PRINT "Number is positive"
ELSE
  PRINT "Number is zero"
END IF