Determine output:
void main()
{
int i=10;
i = !i>14;
printf("i=%d", i);
}
void main()
{
int i=10;
i = !i>14;
printf("i=%d", i);
}
A. 10
B. 14
C. 0
D. 1
E. None of these
Answer: Option C
Solution(By Examveda Team)
In the expression !i>14 , NOT (!) operator has more precedence than ' >' symbol. ! is a unary logical operator. !i (!10) is 0 (not of true is false). 0>14 is false (zero).
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
First we solve i>14 and then !