Example 1: A BASIC program has the following
- Line number(s) (b) Remark (REM) (c) Assignment (LET, INPUT, DATA) (d) Output statement (PRINT, WRITE) (e) Terminators (END, STOP) (f) Conditional statement (IF, ELSE, AND, OR, etc)
- REM Program to write (or print) numbers 1 to 20.
10 START
20 A = 0; B = 0
30 INPUT a
40 IF A<1 THEN GO TO 30
50 PRINT A
60 A = A + 1
70 IF A< 20 THEN GO TO 90
80 GO TO 50
90 STOP
- REM: Program to find the average of 10 numbers.
10 START
20 A = 10; B = 0; C = 0; D = 0
30 A = A + 1
40 READ B
50 C = C + B
60 IF A>10 THEN GO TO 80
70 GO TO 30
80 = C/10
90 PRINT D
100 END D
110 STOP
EVALUATION
- Write a simple BASIC program to print number 1 to 14
- Program to find the average of 6 numbers.
Interesting! But there are no semicolon at the end of each statements in the two examples above.
Love it
Thank you Tunde, We appreciate this.