Skip to content

ELEMENTS OF QBASIC

Every programming language consists of some basic elements which are required to make a program. The element required to construct a BASIC program consists of a set of characters, keywords, constants, variables, operators and expressions.

 

  1. CHARACTER SET

The BASIC Character Set consists of alphabets (both small and capital), numbers (0 to 9) and special characters. These special characters have their own meaning and function.

 

  1. KEYWORD

Keywords are those words which have special meanings in BASIC. Keywords are statements or Reserved Words, commands, and names of operators. Some reserved words are CLS, REM, INPUT, LET, PRINT, FOR, DO, SELECT, MID$, ASC, SQR, LEN, LEFT$, TIME$ and INT.

 

  1. CONSTANTS

Constants are the data or the values in a program that cannot be changed during the program execution. The data may be a letter, words, numbers, or special characters. Types of constant are

  1. Sting Constant
  2. Numeric Constant

 

  1. VARIABLE

A variable is an entity that stores data needed to be used in a program. Each program defines different number of variables.

There are mainly two types of variables. They are:

  1. String Variable
  2. Numeric Variable

 

  1. OPERATOR

Operators are symbols that indicate the type of operation BASIC has to perform on the data

There are four types of operators in BASIC. They are Arithmetic Operators, Relational Operators, Logical Operators and Sting Operator.

 

QBasic’s Math Operators  

OBJECTIVES:

  • Using QBasic Math Operators
  • Use Order of Operation
  • Store the results of calculations in variables
  • Print the result of calculations

 

A Math Operator is a symbol use for addition, subtraction, multiplication, division, or other calculations

The QBasic math operators and their meanings.

Symbol Meaning
* Multiplication
/ Division
+ Addition
Subtraction
^ Exponentiation
\ Integer division
MOD Modulus

 

Example:   (95/2=47.5)

Formula Results
8\2 4
95\2 47
95.0\2 47
95\2.0 47
95.0\2.0 47

See also:

PROGRAMMING LANGUAGE

INTRODUCTION TO DATA PROCESSING

Computer Input devices and Output devices

Data and Information

Output Devices II

 

Related Words

  • basic programming language
  • basic programming language tutorial
  • basic programming language download
  • basic programming language commands
  • basic programming language pdf
  • basic programming language examples
  • basic programming language online
  • basic programming language history
  • basic programming language for windows 10
  • basic programming language for beginners
  • qbasic
  • qbasic gorillas
  • qbasic programming
  • qbasic download
  • qbasic online
  • qbasic commands
  • qbasic emulator
  • qbasic 64
  • qbasic nibbles
  • qbasic programming language
SUBSCRIBE BELOW FOR A GIVEAWAY

Leave a Reply

Your email address will not be published. Required fields are marked *

School Portal NG