Accept the following: Type "short int" is of size 2 bytes. Type "int" is of size 4 bytes. Type "long int" is of size 8 bytes. Type "float" is of size 4 bytes. Type "long" is of size 8 bytes. Type "long double" is of size 16 bytes. For each type determine the following: (a) The number of bits (b) The largest and smallest value (c) The range Show all work. Explain your answers.
Added by Laura K.
Step 1
Short int: (a) Number of bits = 2 bytes x 8 bits/byte = 16 bits (b) Largest value = 2^(16-1) - 1 = 32767 Smallest value = -2^(16-1) = -32768 (c) Range = -32768 to 32767 Show more…
Show all steps
Your feedback will help us improve your experience
Tanvi Garg and 89 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
In Java, a variable of type int is represented internally as a 32 -bit signed integer. Suppose that one bit stores the sign, and the other 31 bits store the magnitude of the number in base $2 .$ In this scheme, what is the largest value that can be stored as type int? (A) $2^{32}$ (B) $2^{32}-1$ (C) $2^{31}$ (D) $2^{31}-1$ (E) $2^{30}$
Match the numerical value with the SMALLEST C data type that can hold it. For example, -33 would fit in a char (pay attention to the sign!), whereas +130 would fit in an unsigned char. -129 A. short +33,000 B. unsigned long -4203.765 C. float D. double +3,183,444 E. unsigned short 4.456e+38
Adi S.
Select the correct alternative from the given choices. 8-bit 2's complement representation a decimal number is 10000000 . The number in decimal is (A) $+256$ (B) 0 (C) $-128$ (D) $-256$
Digital Logic
Number Systems
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD