Programming Languages C Objective
Mar 08, 2013

What will be output of the following c code?
void main()
{
int a=2;
if(a==2){
a=~a+2<<1;
printf("%d",a);
}
else{
break;
}
}

Choose the correct answer:
A) -1
C) -3
D) Compiler error
Detailed Explanation

Keyword break is not part of if-else statement. Hence it will show
compiler error: Misplaced break

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback