4. : The command which display text
and numbers in the screen.
: Helps to make clear the screen after
a command is executed.
: It helps to add text or remark for
the user that will not be executed.
: It stops the execution of the
program.
UJJAL SHARMA
6. The comma causes the output to be displayed after
leaving a gap of approximately 8-10 characters.
Syntax: PRINT “text”, “text”
It will execute the following.
UJJAL SHARMA
7. T h e s e mi c o l o n c a u s e s
t h e o u t p u t t o b e
d i s p l a y e d a f t e r
l e a v i n g n o s p a c e .
Sy n t a x : PRI N T “t e x t ”;
“t e x t ”
Ex e c u t i o n wi l l
UJJAL SHARMA b e t h e
8. Th e Co l o n a l l o ws t o
wr i t e mo r e t h a n o n e
s t a t e me n t o n a s i n g l e
l i n e .
Sy n t a x : PRI NT “t e x t ”:
Pr i n t “t e x t ”
I t wi l l Pr i n t
UJJAL SHARMA t h e
9. We will know about the basic rules to use
Variables.
A variable can be big or small, it may contain
letter or numbers but the first letter should
be a letter.
A variable cannot contain spaces.
A special character is allowed in QBASIC
which is underscore.
UJJAL SHARMA
10. • We will know about three types of
operators:
UJJAL SHARMA
11. Operation Arithmetic Example Output
a = 20
Symbol b = 10
Addition + PRINT a + b 30
Subtraction - PRINT a - b 10
Multiplication * PRINT a * b 200
Division / PRINT a/b 2
Parenthesis () PRIN a + (b*2) 40
Raising to a power PRINT a ᶺ2 400
ᶺ
UJJAL SHARMA
12. Operation Relational Example Output (Will
a = 20
Symbols b = 10 result in TRUE
or FALSE)
Greater than > a>b TRUE
Greater than or equal to >= a>=b TRUE
Less than < a<b FALSE
Less than or equal to <= a<=b FALSE
Equal to = a=b FALSE
Not equal to <> a<>b TRUE
UJJAL SHARMA
13. Operation Relational Example Output (Will
a = 20
Symbols b = 10 result in TRUE
c = 50 or FALSE)
AND (All the AND a>b and a>c False
conditions must be Here, cond1 (a>b) is
true for the final true but cond2 (a>c)
result to be true) is false. So the final
result is false.
OR (Any one or all OR a>b and a>c True
the conditions Here, since one
should be true for condition i.e. cond1
the final result to be (a>b) is true, so the
true) final result is true.
UJJAL SHARMA
14. • We will know about 3 statements:
UJJAL SHARMA
15. • When a value of a variable is required to be
accepted during the execution of the program,
then the INPUT command is used.
• Syntax: INPUT Variable name
Example
The output is in next slide.
UJJAL SHARMA
18. • GOTO command is used to shift the control of the
program to the desired command. To specify where the
control of the program should go, label name is
specified along with the GOTO command.
• Example,
The label name is
always followed by
a colon
Output will be
UJJAL SHARMA