Answer to Question #154519 in C for Anshul Ghanghoria

Question #154519

Given a compiler which allocates 4 Bytes of memory to an integer variable, then what is the range of numbers that can be stored in such variable? Explain your answer.



1
Expert's answer
2021-01-08T13:18:37-0500

A bit can store either one or a zero in which a byte has 8bits.to calculate possible value you take

2n where n is the number of bits.A four byte has 32 bits hence n will be 32

Hence 232=(4294967296 values) starting from zero numbers are

0 to +4,294,967,295 for singed int and

-2,147,483,648 to +2,147,483,647 for unsigned int.The values are divided in between for negative and positive values


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS