Q17
What is the result of the expression 3 * (4 + 2) in C?
A.
18
AnswerB.
24
C.
9
D.
14
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 3 * (4 + 2) is evaluated as follows: First, the expression inside the parentheses is calculated (4 + 2), which results in 6. Then, the multiplication is performed: 3 * 6, which indeed equals 18.