What will the output of the following C code be?#include stdio.h> void main() int x = 1, z = 3; int y = x 3; printf(" percent dn", y);
A. -2147483648
B. -1
C. Run-time error
D. 8
Answer:D
What will the output of the following C code be?#include stdio.h> void main() int x = 1, z = 3; int y = x 3; printf(" percent dn", y);
A. -2147483648 B. -1 C. Run-time error D. 8
Explanation: As we all know, the binary code for 1 is 0001. So x3 indicates that we must shift the value three times to the right. 0001 0010 0100 1000 0001 0010 0100 1000 0001 0010 0100 1000 0001 0010