File: elseif.bas

package info (click to toggle)
bwbasic 2.20pl2-13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,764 kB
  • sloc: ansic: 21,002; makefile: 80
file content (26 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

rem -----------------------------------------------------
rem elseif.bas -- Test MultiLine IF-ELSEIF-THEN statement
rem -----------------------------------------------------

Print "ELSEIF.BAS -- Test MultiLine IF-THEN-ELSE Constructions"

Print
Print "The program should detect if the number you enter is 4 or 5 or 6."
Input "Please enter a number, 1-9"; x

If x = 4 then
   Print "The number is 4."

Elseif x = 5 then
   Print "The number is 5."

Elseif x = 6 then
   Print "The number is 6."

Else
   Print "The number is neither 4 nor 5 nor 6."

End If

Print "This concludes our test."