Computer Science, asked by aditya92755, 1 month ago

c) What will be outputs of the following Basic program

10 A = 10
20 B = 15
30 C = A+B
40 PRINT "C"
50 PRINT C
60 END

Answers

Answered by anindyaadhikari13
3

\texttt{\textsf{\large{\underline{Given C{o}de}:}}}

10 A = 10

20 B = 15

30 C = A+B

40 PRINT "C"

50 PRINT C

60 END

Language: QBASIC.

\texttt{\textsf{\large{\underline{O{u}tput}:}}}

C

25

\texttt{\textsf{\large{\underline{Explanation}:}}}

  • Line 1: A variable named 'A' is declared and initialized with value - 10.
  • Line 2: Another variable named 'B' is declared and initialized with value 0 15.
  • Line 3: The variable 'C' stores the sum of A and B which is 10 + 15 or 25.
  • Line 4: Letter "C" is printed and not the value of variable C!
  • Line 5: Now the value of the variable C is printed i.e., 25.
  • Line 6: End of program.

See attachment for verification.

Attachments:
Similar questions