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
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 C Miscellaneous
Determine output:
void main()
{
int const *p=5;
printf("%d", ++(*p));
}
A. 6
B. 5
C. Garbage Value
D. Compiler Error
A. mmm nnn aaa
B. mmmm nnnn aaaa
C. Compiler Error
D. None of These
A. I hate Examveda
B. I love Examveda
C. Error
D. None of These
Determine Output:
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
A. 5 5 5 5 5
B. 5 4 3 2 1
C. Infinite Loop
D. None of These
wrong answer answer is error