Bird
0
0

You want to store a large positive number that fits in 64 bits but never needs to be negative. Which type modifier combination is best in C?

hard📝 Application Q15 of 15
C - Variables and Data Types
You want to store a large positive number that fits in 64 bits but never needs to be negative. Which type modifier combination is best in C?
Ashort unsigned int
Bunsigned long long int
Clong int
Dsigned long long int
Step-by-Step Solution
Solution:
  1. Step 1: Identify size and sign requirements

    64 bits means 'long long' type; only positive means 'unsigned'.
  2. Step 2: Match modifiers to requirements

    'unsigned long long int' fits large positive numbers without negatives.
  3. Final Answer:

    unsigned long long int -> Option B
  4. Quick Check:

    64-bit positive number = unsigned long long int [OK]
Quick Trick: Use 'unsigned long long int' for large positive 64-bit numbers [OK]
Common Mistakes:
  • Choosing signed type when negatives not needed
  • Using 'short' which is too small
  • Ignoring 'unsigned' for positive-only data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes