Vidyalelo
C Programming · Q3

Arrays and Strings

Programming · C Programming · question 3

Q3

What is the size of an integer array declared as int arr[5] in bytes?

A.
10
B.
20
Answer
C.
4
D.
5

Answer: Option B

Solution

Answer: Option B
Solution:
The size of an integer array declared as int arr[5] in bytes depends on the size of an integer in the system. Typically, the size of an int is 4 bytes.

Calculation:
The array arr has 5 elements.
Each int is 4 bytes.
Total size = 5 * 4 = 20 bytes
Therefore, the size of int arr[5] is 20 bytes.