Q10
What is the result of the expression (6 - 2) * (1 + 2) in C?
A.
12
AnswerB.
18
C.
9
D.
4
Answer: Option A
Solution
Answer: Option A
Solution:
In C, arithmetic expressions follow the order of operations (PEMDAS/BODMAS), where parentheses have the highest precedence. Therefore, the expression (6 - 2) is evaluated first, resulting in 4, and (1 + 2) is evaluated as 3. Then, these results are multiplied: 4 * 3, which equals 12