Vidyalelo
C Programming · Q7

Operators and Expressions

Programming · C Programming · question 7

Q7

What is the result of the expression 10 - 5 * 2 in C?

A.
20
B.
10
C.
0
Answer
D.
-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.