38 lines
662 B
Text
38 lines
662 B
Text
|
|
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
|