- A 65536 -10
- B 0 65536
- C 0 0
- D Compilation error
- Share this MCQ
Answer:
C
Share this MCQ
Consider on the expression:
x = 10 +- 10u + 10u +- 10;
10: It is signed integer constant.
10u: It is unsigned integer constant.
X: It is signed integer variable.
In any binary operation of dissimilar data type for example: a + b
Lower data type operand always automatically type cast into the operand of higher data type before performing the operation and result will be higher data type.
As we know operators enjoy higher precedence than binary operators. So our expression is:
x = 10 + (-10u) + 10u + (-10);
= 10 + -10 + 10 + (-10);
= 0
Note: Signed is higher data type than unsigned int.
So, Corresponding signed value of unsigned 10u is +10
Click me to Read more Question & Answer of Data Types in C LanguageShare this MCQ