in qbasic what statement directs the computer to go to a particular statement of the program
Answers
A QBASIC statement is a command to perform certain task. The followings are QBASIC statement
CLS
END
LET
INPUT
REM
1. CLS
Syntax
CLS
It clears the screen.
eg. CLS
2. PRINT
Syntax
PRINT "Control String";Variable list
It is used to print values of variables .
Eg.
CLS
A=12
PRINT "The value of A is ";A
END
The output of the given program will be
The value of A is 12
3. END
Syntax
END
It terminates the program.
E.g.
CLS
A= 23
PRINT A
END
4. INPUT
Syntax
INPUT "Control String";Variable
It allows us to enter a value from keyboard and assign this value in variable.
E.g.
CLS
INPUT "Enter a number1";N1
INPUT "ENter a number2";N2
S=N1+N2
PRINT "Sum of two numbers is ";S
END
This program allows us to input two numeric values and assign these value in variable N1 and N2 . The Program can calculate sum of these two numbers and finally print the result i.e. S.
5. REM
Syntax
REM Remarks
This statement is used to write programmer remarks in program. The remarks can't be executed After the REM statement it is just a remarks which helps to memorize the meaning of the code just written in past time.
We can use ' instead of REM leywords
E.g.
CLS
REM this program calculate area of a square
INPUT "Enter a length";L
A=L^2
"Area of a square is ";A
END