Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that a short is represented by 6 bits and an int is represented by 10 bits. What is the output generated by the following

Assume that a short is represented by 6 bits and an int is represented by 10 bits. What is the output generated by the following code segment:

int x = 58;

int y = -58;

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions