Computer Science, asked by CARELESSGIRL, 1 year ago

Is that possible to store 32768 in an int data type variable?

Answers

Answered by EHSASS
7

╰☆☆ ʜᴇʀᴇ ɪs ʏᴏᴜʀ ᴀsᴡᴇʀ ☆☆╮

According to me yes it is possible

 Int data type only capable of storing values between – 32768 to 32767.To store 32768 a modifier needs to use with int data type. Long Int can use and also if there is no any negative values unsigned int is also possible to use.

ᴇʜsᴀss ✿◕ ‿ ◕✿

Answered by liza10987654321
2

☞NO, You cannot store the value +32768 in an int variable but you also wont get any error during compilation if you do so. You can use unsigned int instead of int. The reason is 2 bytes correspond to 16 bits. Since it is a signed variable so the 15th bit (0-indexed) is reserved for sign purpose.

✌✌✌✌✌✌

Similar questions