What is QBasic?
Definition: QBasic is a simple programming language developed
by Microsoft. It stands for Quick Beginners All-Purpose Symbolic
Instruction Code.
Developer: It was developed by Microsoft.
Development Time: QBasic was first developed in the early
1980s.
Versions: Different versions of QBasic were released over time,
with QBasic 1.1 being one of the widely known versions.
2. How to Download QBasic and Install?
Download: QBasic is an older programming language and may
not be readily available for download. It was often included with
MS-DOS or Windows operating systems. You can search for it on
online archives or use alternative emulators.
Installation: If available, installation is typically straightforward.
Follow the on-screen instructions or copy the QBasic files to your
desired directory.
3. Entering the First Program:
To enter the first program in QBasic, you can use the built-in
editor. Open QBasic, type your program, and save it with a .BAS
extension.
4. Running a Program:
After entering a program, run it by pressing F5 or selecting "Run"
from the menu. This executes the code and displays the output.
5. Saving a Program, Getting a New Screen, Opening/Loading a
Program, Exiting from QBasic:
Saving: Save a program using the Save option in the File menu.
New Screen: Use the New option in the File menu to get a new
screen for writing a new program.
Opening/Loading: Open or load an existing program from the
File menu.
Exiting: To exit QBasic, use the Exit option in the File menu or
simply close the program.
Elements of QBasic:
QBasic consists of elements like commands, statements, variables,
expressions, etc.
Character Set:
A character set is a set of characters that a programming language
can recognize and use.
Examples include letters (A-Z, a-z), digits (0-9), and special
characters like punctuation.
Constant:
A constant is a value that does not change during the execution of a
program.
Examples include numeric constants like 5 or string constants like
"Hello."
Variable:
A variable is a storage location in the computer's memory that can
hold different values during program execution.
Types include numeric variables (holding numbers) and string
variables (holding text).
Expression:
An expression is a combination of values, variables, operators, and
functions that results in a single value.
Examples: "5 + x," "A$ + B$."
Operators:
Operators are symbols used to perform operations on variables and
values.
Examples include addition (+), subtraction (-), multiplication (*),
and division (/).
Statement in QBasic:
A statement is a complete instruction in QBasic.
Types include input, output, assignment, declaration, and more.
Declaration Statement:
A declaration statement is used to declare the type of a variable.
Example: DIM x AS INTEGER.
Rem Statement:
Rem (remark) statement is used for adding comments in the code
for clarity.
Example: REM This is a comment.
Constant Statement:
Constant statements define symbolic names for values.
Example: CONST Pi = 3.14.
Dim Statement:
Dim statement is used for dimensioning arrays.
Syntax: DIM arrayName(subscripts).
Assignment Statement:
An assignment statement is used to
An assignment statement is used to assign a value to a variable.
Example: x = 5.
Input and Output Statements:
Input statement is used to receive data from the user.
Example: INPUT "Enter your name: "; Name$.
Output statement is used to display data.
Example: PRINT "Hello, "; Name$.
CLS Statement:
CLS statement is used to clear the screen.
Example: CLS.