Monday 19 September 2016

QBASIC DATA


Data is a collection of facts and figures that is entered into the computer through the keyboard. Data is of two types:

1. CONSTANT: Data whose value does not change or remains fixed. There are two types of constants:

(a) NUMERIC CONSTANT: Numbers - negative or positive used for mathematical calculations
e.g. –11, 22, 0

(b) ALPHANUMERIC CONSTANT / STRING: Numbers or alphabets written within double quotes(inverted commas “ “).
e.g. “Computer”, “Operating System”


2. VARIABLE: Data whose value is not constant and may change due to some calculation during the program execution. It is a location in the computer’s memory, which stores the values. Depending on what value is held, Variables are of two types:

(a) NUMERIC VARIABLE: The variable that holds a Numeric Constant for arithmetic calculations (+, - ,*, / ) is called a Numeric Variable.
e.g. A = 22, here A is the Numeric Variable

(b) ALPHANUMERIC VARIABLE: The variable that holds an Alphanumeric Constant, which cannot be used for arithmetic calculations, is called Alphanumeric Variable or String Variable. An Alphanumeric variable must end with a $ sign and the Alphanumeric constant must be enclosed in inverted commas.
e.g. Name$ = “Abhijeet”, here Name$ is an Alphanumeric Variable


No comments:
Write comments