SIMPLE BASIC PROGRAM

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)
  1. 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

 

  1. 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

  1. Write a simple BASIC program to print number 1 to 14
  2. Program to find the average of 6 numbers.

3 thoughts on “SIMPLE BASIC PROGRAM”

Leave a Comment

Your email address will not be published. Required fields are marked *