Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

The Basic programming language is a simple and easy to understand programming language

Uploaded by

jhnfrkn111
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

The Basic programming language is a simple and easy to understand programming language

Uploaded by

jhnfrkn111
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Basic elements of BASIC

1. Identifiers
2. Comments
3. Operators
4. Expressions
5. Instructions
6. Constants
7. Variables
8. Symbols
9. Directives
10. Labels
11. Procedures and functions
12. Modules

CONSTANTS
A constant is a number or a character the value of which cannot be
changed during the program execution. Unlike variables, constants are
stored in ROM memory of the microcontroller in order to save as much
memory space of RAM as possible. The compiler recognizes constants
by their names and prefix const. Every constant is declared under
unique name which must be a valid identifier. Constants are available
in decimal, hexadecimal and binary formats. The compiler
distinguishes between them according to their prefixes. If a constant
has no prefix, it is considered decimal by default. There are two types
of constants:
1. String constant
2. Numeric constant
VARIABLES
A variable is a named object able to contain a data which can be modified
during program execution. Every variable is declared under a unique name
which must be a valid identifier. For example, to add two numbers
(number1 + number2) in the program, it is necessary to have a variable to
represent what we in everyday life call the sum. In this
case number1, number and sum are variables. There are two types of
variables:
Numeric variable
String variable
Basic operators
Operators perform mathematical or logical operations on values. The
operators provided by basic are divided into four:
1. Arithmetic operations
2. Relational operations
3. Logical operations
4. Functional operations.

BASIC STATEMENT AND THEIR MEANING


REM: is a non executable statement used to insert comments
INPUT: the input statement allows a value, numeric or character string to be
typed at the keyboard of a computer and stored on a computer memory at
the data name specified.
Output: the print statement is used to perform calculations and display
results. It is also used to display alphanumeric messages.
Looping: the FOR statement is used in combination with the NEXT
statement to specify program loops. WHILE and NEXT is also used to create
program loop
Control statement: the IF THEN statement test a condition and redirect
program control if the condition is true.
GOTO statement: the GOTO statement is used to transfer control to
another line statement in a program.
End statement: The END statement terminates execution of a program. It
informs the basic compiler that it has reached the last line of the program.

You might also like