Published by: BhumiRaj Timalsina
Published date: 16 Jan 2022
QBASIC is the most popular high level programming language. Various versions of BASIC have been developed by Microsoft Company. This language is quite simple to understand and has been adopted by most of the microcomputers. It is suitable for both mathematical and business problems. It is compatible with MSDOS environment and it has two basic files QBASIC.EXE and QBASIC.HLP. We can edit, debug and execute the program using these two files.
It occupies very low memory so it may be possible to run the system using floppy disk also. It is compatible with MS-DOS and have only two files QBASIC.EXE and QBASIC.HLP
When you are working with Windows system. Open QBASIC Folder on Windows.
Double click over the QBASIC.EXE icon. We will get the QBASIC System as below. Press ESC key and get the programming window of the QBASIC and type the program on the working of QBASIC.
Structure of Basic
To construct the QBASIC program we have to arrange some standard elements.
The Character Set
QBASIC has the character set consisting of the following elements:
The symbol ^ (caret) is used to denote exponentiation operator, the symbol * (asterisk) is used to denote multiplication and other symbols; have their usual meanings.
Constants and Variables
A quantity in a computer program which does not change its value during the execution of the program is called a constant and the quantity which may change its values during the execution of the program is called variable. QBASIC allows the following constants:
Numeric constant is one that is formed by a sequence of digits 0, 1, 2,.....9 and may include a decimal point. A numeric constant known as number may be integer or a real number. 383, +57, 0, -6.2 and 6.15E4 are valid numeric constants. The number 6.15E4, in fact represent 6.15 * 104. The notation E is used to represent exponential form. The number after E is the exponent which can be positive or negative. However, its length cannot exceed two digits.
It is also important to keep in mind that
A string constantconsists of a sequence of characters which must be enclosed by a quotation mark.