BASIC PROGRAMMING
BASIC is one of the simplest programming languages in computer Programming. BASIC (an acronym for
Beginner's All-purpose Symbolic Instruction Code) is a high-level programming languages.
BASIC CHARACTER
a. Alphabets A-Z
b. Digits 0 – 9
c. Special Characters: +, -, *, <, >, (), . etc.
BASIC STATEMENTS
i. CLS
ii. LET
iii. READ
iv. INPUT
v. REM
vi. DATA
vii. PRINT
viii. END
1. CLS This means Clear Screen Every BASIC Program must begin with CLS to avoid getting unexpected
display on the screen
Example: 10 CLS
20…..
2. REM: The Rem means REMARK Any BASIC Statement that begins with tem is not executed. Therefore it is
used to make the program mas readable.
Example: 10 REM "This program will calculate the total of two numbers"
20…
3. LET: The Let Statement is used to assign a value to a variable.
Example: 10 LET A = 10 (assigns the value of 10 to A)
20 LET B = 20 (assigns the value of 20 to B)
30 LET C = 40 (assign the value of 40 to C)
4. INPUT: The INPUT Statement allows a value, numeric or character string to b typed into the Computer via
the keyboard and stored in the computer’s memory at the data named specified
Example: 10 INPUT A
5. DATA: The READ and DATA statements work hand in hand. They are used whit large amount of data is to
be entered into the computer memory through the keyboard It is used instead of INPUT statement when large
amount of data involved
Example: 10 READ A, B, C, D
20 DATA 20, 30, 40,50
6. PRINT: This is an output statement that allows a literal or the content of the data named specified to be
printed on the monitor or Printer.
Example: 30 PRINT "WELCOME TO GSS JABI" (This line will Print WELCOME TO GSS JAB" on the
monitor and returns the cursor)
7. END: this indicates the end of a BASIC program. It is compulsory otherwise the program will have no end.
example: 30 END
BASIC ARTHMETIC OPERATORS
i. Bracket ()
ii. Exponential ^
iii. Division /
iv. Addition +
v. Subtraction -
vi. Multiplication *
SIMPLE BASIC PROGRAMS.
Program to Compute 20*10
10 REM" THIS PROGRAM WILL COMPUTE"
20 REM 20*10
30 CLS
40 LET A = 20
50 LET B = 10
60 LET C = A + B
70 PRINT C
80 END
Assignment
1. Write a Program to Calculate the Area of a trangle (1/2 * B*H)
2. 2 Write a BASIC Program to calculate the sum of the given variables A, B, C, D, E. and F (Given A = 10, B =
20, C = 30, D = 40 E = 50 and F = 60)