Q7
What is the result of the expression 10 - 5 * 2 in C?
A.
20
B.
10
C.
0
AnswerD.
-5
Answer: Option C
Solution
Answer: Option C
Solution:
In C, arithmetic expressions follow the order of precedence, where multiplication and division have higher precedence than addition and subtraction. Therefore, in the expression 10 - 5 * 2, the multiplication (5 * 2) is performed first, resulting in 10 - 10, which indeed equals 0.