Concept:QBASIC evaluates arithmetic expressions according to operator precedence. Exponentiation is done first, then multiplication and division, and finally addition and subtraction.
Explanation:Start with the given expression:
5+3∗4/2−32In QBASIC, the exponent operator
has the highest priority. So first compute
32=9.
The expression becomes:
5+3∗4/2−9Next, carry out multiplication and division from left to right:
3∗4=12, then
12/2=6.
Now the expression is:
5+6−9Finally, perform addition and subtraction from left to right:
5+6=11, then
11−9=2.
Thus, the expression evaluates to
2.
Answer:C.
2