C output type question

Q.  Trace the output.

void main()
{
int x=10,y=20;
x=!x;
y=!y;
printf("x=%d , y=%d",x,y);
}

- Published on 17 Jun 15

a. x= -10 , y= -20;
b. x= 10 , y= 20;
c. x=0 , y=0;
d. None of the above.

ANSWER: x=0 , y=0;

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)