Question: Assume that a short is represented by 1 1 bits and an int is represented by 1 7 bits. What is the output generated by

Assume that a short is represented by 11 bits and an int is represented by 17 bits.
What is the output generated by the following code segment:
int x =5123;
int y =-5123;
short sx =(short)x;
short sy =(short)y;
printf("%d %d %d %d",x, y,(int)sx,(int)sy);
printf("%x %x %x %x",x, y,(int)sx,(int)sy);
printf("%u %u %u %u",x, y,(int)sx,(int)sy);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!