What is the result of the expression 5 * (1 + 2) - 3 in C?
What is the result of the expression 5 * (1 + 2) - 3 in C? Correct Answer 12
In C, arithmetic expressions follow the order of operations (PEMDAS/BODMAS), where parentheses have the highest precedence. Therefore, the expression (1 + 2) inside the parentheses is evaluated first, resulting in 3. Then, the multiplication is performed: 5 * 3, which equals 15. Finally, the subtraction is performed: 15 - 3, which equals 12.Option B (15) is incorrect because it represents the result of the multiplication but doesn't consider the subsequent subtraction.
Option C (10) is incorrect because it doesn't represent the correct result of the expression.
Option D (6) is incorrect because it doesn't consider both the multiplication and subtraction; the correct result is 12.
মোঃ আরিফুল ইসলাম
Feb 20, 2025