differentiate the use of print statement with comma and semicolon by using example.
Answers
Answer:
Differentiate between the use of PRINT statement with comma and semicolon by using examples. Ans. PRINT with Semi Colon: It is used to display the values One after another, without any space in between. PRINT with Comma: It is used to display the values one after another with plenty of spaces in between.
Answer:
PRINT with comma (,)
1. PRINT with comma it is used to display the values one after another with plenty of space (normal 14) in between.
2. Syntax:
PRINT (variable) , (variable) , (variable),.........
3. LET X =78
LET Y =22
Z=X+Y
PRINT X, Y, "SUM", Z
END
PRINT with semicolon (;)
1. PRINT with semicolon is used to display the values one after another without any space in between.
2. Syntax:
PRINT (variable); (variable) ; (variable) ;............
3. LET X$ = "MY NAME"
LET Y$ = "IS"
LET Z$ = "RIA"
PRINT X$ ; Y$ ; Z$
PRINTX X$ ; " " ; Y$ ; " " ; Z$
END