BASIC PROGRAMMING LANGUAGE
BASIC is one of the simplest programming languages. In computer programming, BASIC an
acronym (Beginners All Purpose Symbolic Instruction Code) is a high-level programming
language. BASIC was designed in 1964 by John George &Thomas Eugene Kurtz at Dartmouth
College. It was developed to provide computer access to non – science students. In BASIC,
statements are written in English –like and mathematical notations.
BASIC CHARACTERS
BASIC has a character set consisting of the following characters:
(1) Alphabets A-- Z
(2) Digits 0—9
(3) Special characters +, _, *, /, \ , ( ), $, < >, ^ etc.
BASIC STATEMENTS
In BASIC, programs are written in lines, each line starts with a line number which is a label of that
particular line. Each line is called a statement. Line vary between 1 and 999.
Keywords that are used to form BASIC statements
a. CLS – clear screen: Every Basic program must begin with clear screen to avoid getting
unexpected display on the screen
b. REM – REMARK: It is used to make the program more readable
c. LET: This is used to assign value to a variable
d. INPUT: This allows value, numeric, character string to be typed into the computer
e. DATA: The READ and DATA statement work hand in hand, they are used when large amount
of data is to be entered into the computer memory through the keyboard
f. PRINT: This is an output statement that allows the content of the data name specified to be
printed on the monitor or printer.
g. END: This is indicates the end of a BASIC program
h. GO TO
BASIC ARITHMETIC OPERATORS
The following are arithmetic operators in BASIC organized in their order of execution
() Bracket
^ Exponential
/ Division
*Multiplication
+ Addition
_ Subtraction
BASIC ARITHMETIC EXPRESSION
The following are algebraic expression and their corresponding BASIC arithmetic expression
Algebraic Expression BASIC arithmetic expression
a+b A+B
a-b A-B
b/c B/C
b5 B^5
Simple BASIC programs
The following are some simple BASIC programs
EXAMPLE1
Write a program to compute 20*10
10 REM “THIS PROGRAM WILL COMPUTE
20 REM20*10
30 CLS
40 LET A= 20
50 LET B= 10
60 LET C= A*B
70 PRINT C
80 END