Bird
0
0

You want to store 1000 integers in an array on a 32-bit system. If int is 4 bytes, how much memory in bytes will the array consume?

hard📝 Application Q15 of 15
C - Variables and Data Types
You want to store 1000 integers in an array on a 32-bit system. If int is 4 bytes, how much memory in bytes will the array consume?
A2000 bytes
B1000 bytes
C4000 bytes
D8000 bytes
Step-by-Step Solution
Solution:
  1. Step 1: Identify size of one integer

    On a 32-bit system, int typically uses 4 bytes.
  2. Step 2: Calculate total memory for 1000 integers

    Total memory = number of elements x size of each element = 1000 x 4 = 4000 bytes.
  3. Final Answer:

    4000 bytes -> Option C
  4. Quick Check:

    1000 x 4 = 4000 bytes [OK]
Quick Trick: Multiply count by size of int (4 bytes) [OK]
Common Mistakes:
  • Using size 2 bytes for int
  • Multiplying by 8 bytes (double size)
  • Confusing bits with bytes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes