User Forum

Subject :ICSO    Class : Class 6

What is the output of the following QBasic program code?
REM A QBASIC Program
CLS
LET A$="5"
LET B$="4"
LET C$=A$+B$
PRINT "Sum=";C$
END

ASum=9
BSum=54
CSum=5+4
D54


Why is this? the correct option given here is opt c; but I think it should be opt a. Anybod could explain what is going on?

Ans 1:

Class : Class 8
Option b is correct because A and B are string variables. I mean to say Variable A has a string Value 5 and variable B has a string value 4 stored in it. Variable C which is an output variable is also a string variable bcoz it is declared as C$. So Sum=C$ means Sum=A$+B$ ,+ means concatenation. 5 and 4 are concatenated that is Sum=54.

Ans 2:

Class : Class 4

Post Your Answer