For the following code, assuming a short integer is 16 bits,short y = 30000; short x = y + 10000
Answers
Answered by
16
"-25536" is the output from the above code.
Explanation:
- The sort is an integer type data type which takes the 2 bytes or 16 bits for storage. It also takes the value from "-32,768 to 32,767".
- So when a user adds 10000 into 30000 then after 32,767 the addition comes in the negative direction.
- It means when the user adds 1 to 32,767, then he gets the -32768 and when he adds the 2 on 32767, then he gets the -32767.
- So when the user adds the 10000 on 30000, then he gets the -25536.
Learn More :
- C-Program : https://brainly.in/question/12809215
Similar questions