What is the Output of this qbasic program
![What is the Output of this qbasic program class=](https://us-static.z-dn.net/files/d66/6236cd18eddbb64791e19384c68d7a3d.jpg)
Answer:
The output will be: 10
Explanation:
Let us look at the code line by line
CLS
This line will clear the screen before output.
LET A = 10
This line will assign the value 10 to A
LET B=20
This line will assign the value 20 to B
LET C = (A+B)/3
This line will first calculate the value of sum of A and B, divide it by 3 and then store it in C.
[tex]A+B = 10+20 = 30\\(A+B)/3 = 30/3 = 10[/tex]
The value 10 will be stored in C
LET D = C^2
This line will calculate the square of value of C and store it in D
So the value in D will be: 10^2 = 100
PRINT C
This will print the value of C on screen.
The output will be: 10