Skip to main content

QBasic

 QBasic




  • QBasic is a high level programming language developed by Microsoft Corporation in 1985. It is modular programming language where program is divided in different modules or procedures. Qbasic is easy to learn. It uses English like keywords and mathematical symbols to write a program.
  • Elements of QBASIC programming

To construct the QBASIC program, we have to arrange some standard elements.The elements used in Qbasic are as follows: 
Character set 
Variables Constants 
Operator and Operands 
Expression
 Statements
Character Set:
QBASIC has the character set consisting of the following elements:
 Alphabets: A, B, C,....Z 
Digits: 0, 1, 2........,9 and
 Special characters: + - * / ( ) . , $ ; ,: ,= ,> ,< , ^ 

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
A quantity in a computer program which does not change its value during the execution of the program is called a constant. QBASIC allows the following constants:
.Numeric constant
The 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 may be an 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 the 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:
QBASIC does not distinguish between an integer and fraction. Commands are not allowed in a numeric constant. 
The limit on the number of digits that can be used varies from computer to computer.
Normally, a numeric constant can have up to a maximum of eight digits.
String constant
A string constant consists of a sequence of characters which must be enclosed by a quotation mark.
Variables
he quantity which may change its values during the execution of the program is called the variable.
In QBASIC, variables are also of two types:
1.Numeric variable: Numeric variable can assume numeric value and is represented by an alphabet or an alphabet followed by another alphabet or digit. For example A, C, A2, ABC, A6 etc, represent numeric variables.
2.String variable: A string variable is represented by an alphabet followed by dollar ($)sign.Itshouldbekeptinmindthatwhileconstructingthestringvariable,dollar($) should be the last character. For example, B1,NAME , BOOK1$, etc are valid string variables.
Expression
An expression can be a string, or numeric constant, a variable or a combination of constants, variables with operators which returns a single value.

Operands
Operands are the data or variables on which mathematical, logical and string operations take place.
Operators
Operators are the symbols, which are used in arithmetic operations, logical expressions, and string expressions.
Statements 
A statement is a set of instructions written using keywords or commands of QBASIC. Every programming language uses keywords as a statement with certain syntax.


Comments

Popular posts from this blog

HTML

 HTML INTRODUCTION HTML stands for HyperText Markup Language. It is used to design web pages using a markup language. HTML is a combination of Hypertext and Markup language. Hypertext defines the link between web pages. A markup language is used to define the text document within the tag which defines the structure of web pages. This language is used to annotate (make notes for the computer) text so that a machine can understand it and manipulate text accordingly. Most markup languages (e.g. HTML) are human-readable. The language uses tags to define what manipulation has to be done on the text. HTML is a markup language used by the browser to manipulate text, images, and other content, in order to display it in the required format. HTML was created by Tim Berners-Lee in 1991. The first-ever version of HTML was HTML 1.0, but the first standard version was HTML 2.0, published in 1995. Elements and Tags: HTML uses predefined tags and elements which tell the browser how to properly dis...