Variable in QBASIC
A variable is a quantity which can store value in computer memory. A variable is also a quantity whose value changes during the execution of a program. Like in mathematics a variable holds certain value Just in QBASIC; it is a placeholder for storing value in computer memory.
Some rules for making variable
Note:
A string variable always ends with $ symbol.
Some rules for making variable
- The first character always start with letter (i.e. lowercase or uppercase letter).
- The first character should not begin with numbers (i.e. numeric character).
- The string variable always ends with dollar ($) symbol.
- The maximum variable length must be 40 characters
Types of variable
- Numeric Variable
- String Variable
1. Numeric variable:
A variable which can store numeric value is called numeric variable.
e.g.
A=12
pi=3.14
c=79.89
2. String variable:
A variable which can store string variable is called String variable. String is a array of character enclosed within the double inverted comma.
e.g.
N$="ram"
Place$="Kirtipur Kathmandu"
Note:
A string variable always ends with $ symbol.
Comments