RosettaCodeData/Task/Conditional-structures/M2000-Interpreter/conditional-structures-1.m2000

38 lines
662 B
Plaintext

Module CheckIt {
Read a
If a>1 then {
Print "Top"
} else.if a>=-4 then {
Print "Middle"
} else {
Print "Bottom"
}
}
CheckIt 100
CheckIt 0
CheckIt -100
Module CheckIt {
Read a
\\ using end if without blocks
If a>1 then
Print "Top"
else.if a>=-4 then
Print "Middle"
else
Print "Bottom"
End If
}
CheckIt 100
CheckIt 0
CheckIt -100
Module CheckIt {
Read a
\\ without use of END IF in one line
If a>1 then Print "Top" else.if a>=-4 then Print "Middle" else Print "Bottom"
}
CheckIt 100
CheckIt 0
CheckIt -100