Thursday, 16 August 2012

What will be the output of following c code after compilation and execution? | C Programming

#include<stdio.h>
int main()
{
inta=2;
if(a==2)
{
a=~a+2<<1;
printf("%d",a);
}
else
{
break;
}
return0;
}


A. It will print nothing.
B. -3
C.. -2
D. 1
E. Compiler error

Ans: E

No comments: