C
Programming and Technical
Programming
Program
Assuming a integer 2-bytes, What will be the output of the program?
#include
int main()
{
printf("%xn", -1<<3);
return 0;
}
Options
1) ffff
2) fff8
3) 0
4) -1
Read Solution (Total 2)
-
- Answer is 2)fff8
- 5 years agoHelpfull: Yes(1) No(0)
- In binary: 0000 0000 0000 0001 → represented 1
1111 1111 1111 1111 → represents -1 (2’s compliment of 1)
1111 1111 1111 1110 → -1 - 5 years agoHelpfull: Yes(1) No(0)
C Other Question