adplus-dvertising
frame-decoration

Question

What will be output of the following c code? ( according to GCC compiler)
#include<stdio.h>
int main(){
    signed x;
    unsigned y;
    x = 10 +- 10u + 10u +- 10;
    y = x;
    if(x==y)
         printf("%d %d",x,y);
    else if(x!=y)
         printf("%u  %u",x,y);
    return 0;
}

a.

0 0

b.

65536 -10

c.

0 65536

d.

Compilation error

Posted under Compiler Design

Answer: (a).0 0

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be output of the following c code? ( according to GCC compiler)