What is the result of the expression 5 + 7 * 2 in C?
A. 19
B. 24
C. 26
D. 17
Answer: Option A
Solution(By Examveda Team)
In C and many programming languages, mathematical expressions follow the operator precedence rules. Multiplication (*) and division (/) have higher precedence than addition (+) and subtraction (-).So, when evaluating the expression "5 + 7 * 2," the multiplication is performed before addition:
5 + (7 * 2) = 5 + 14 = 19
Therefore, the result of the expression "5 + 7 * 2" in C is Option A: 19.
Join The Discussion
Comments ( 1 )
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
How