21232_BASIC PROGRAMMING I
21232_BASIC PROGRAMMING I
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…
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
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
ii. Exponential ^
iii. Division /
iv. Addition +
v. Subtraction -
vi. Multiplication *
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)