Statements in QBASIC
A statement is a set of instructions written by using keywords or commands of QBASIC. This note provides an information about different statements used in QBASIC.
Summary
A statement is a set of instructions written by using keywords or commands of QBASIC. This note provides an information about different statements used in QBASIC.
Things to Remember
- A statement is a set of instructions written by using keywords or commands of QBASIC.
- LET is an assignment statement. It is used to assign the value to a variable.
- The remarks may be useful in a program to explain about different kinds of statements and user defined words.
- PRINT statement provides output on the screen.
- The CLS statement clears the screen.
MCQs
No MCQs found.
Subjective Questions
Q1:
Read the above vacancy announcement & answer the following questions:
Who has announced the vacancy?
Type: Short Difficulty: Easy
Q2:
Read the above vacancy announcement & answer the following questions:
What is the qualification for the post?
Type: Short Difficulty: Easy
Q3:
Read the above vacancy announcement & answer the following questions:
What experiences should the candidates have?
Type: Short Difficulty: Easy
Q4:
Read the above vacancy announcement & answer the following questions:
What is the deadline for submitting the application?
Type: Short Difficulty: Easy
Q5:
Write T for true and F for false statements:
Saving the child foundation has announced the vacancy.
Type: Very_short Difficulty: Easy
Q6:
Write T for true and F for false statements:
The candidates should be graduate in Education.
Type: Very_short Difficulty: Easy
Q7:
Write T for true and F for false statements:
The application should be sent to the Executive Director of SCF.
Type: Very_short Difficulty: Easy
Q8:
Write T for true and F for false statements:
Application should be sent after 10th Jan. 2007
Type: Very_short Difficulty: Easy
Q9:
Fill in space with correct information:
The candidates should have ______ in related field.
Type: Very_short Difficulty: Easy
Q10:
Fill in space with correct information:
The office is located in ______.
Type: Very_short Difficulty: Easy
Q11:
Fill in space with correct information:
Save the Children Fund has announced the vacancy for the post of ______.
Type: Very_short Difficulty: Easy
Q12:
Fill in space with correct information:
______ and photocopies of certificates should submit with the application.
Type: Very_short Difficulty: Easy
Q13:
Give one word for the following:
Person with monitoring functions
Type: Very_short Difficulty: Easy
Q14:
Give one word for the following:
Condition of being unoccupied.
Type: Very_short Difficulty: Easy
Q15:
Give one word for the following:
Person who watches and directs an organisation.
Type: Very_short Difficulty: Easy
Videos
No videos found.

Statements in QBASIC
A statement (for the QBASIC) is a set of instructions written by using keywords or commands of QBASIC. Every programming language uses keywords as a statement with certain syntax. The keywords have specific meaning in the QBASIC programming. The statements are the first stored in the memory and executed only when the RUN command is given.
Different statements used in QBASIC are as follows:
CLS Statement
The CLS statement clears the screen. If you write CLS statement in the middle of the program then you cannot see the outputs generated before execution of CLS because it clears the screen.
Syntax: CLS
LET Statement
LET is an assignment statement. It is used to assign the value to a variable. LET is an optional statement i.e. without using LET statement one can assign the value to a variable. The data type must match with the variable type otherwise type mismatch error will occur.
Syntax:|LET| variable = value or expression
Example:
CLS
INPUT " First Number"; A
INPUT "Second Number"; B
let Sum = A+B
PRINT " The Sum is"; S
END
REM Statement
It is a basic declaration statement that allows explanatory remarks to be inserted in a program. The remarks may be useful in a program to explain about different kinds of statements and user defined words. Adding comments in the program allows us to remind about the program and also helps other programmers to understand the logic of the program.
Syntax: REM < Remarks>
Example:
CLS
PRINT "Some text."
REM This text is ignored.
REM This program clears the output screen.
REM and then PRINT " Some text."
PRINT Statement
PRINT statement provides output on the screen. It prints the values of the expression on the screen. If the expression list is blank, no characters are printed. The expressions in the list may be numeric or string. In case of number, the negative number is preceded by a minus sign (-) but in positive number it is preceded by a space.
We can use semicolon and comma with a print statement which results differently than a normal PRINT statement. If expression list ends with comma or semicolon, the next PRINT statement prints on the same line. Comma provides a TAB space, but semicolon provides only one space.
Syntax: PRINT ["Message"]; expression
Example:
CLS
PRINT "Computer is an electronic machine."
PRINT
PRINT "IT's amazing."
PRINT 1000
PRINT " The number is: "; 20
END
Output
Computer is electronic machine
IT's amazing
1000
The number is: 20
Lesson
Computer Programming in QBASIC
Subject
Computer
Grade
Grade 8
Recent Notes
No recent notes.
Related Notes
No related notes.