Vidyalelo
C Programming · Q18

Arrays and Strings

Programming · C Programming · question 18

Q18

What is the result of the expression sizeof(int) in C?

A.
4
Answer
B.
2
C.
8
D.
16

Answer: Option A

Solution

Answer: Option A
Solution:
In C, sizeof(int) returns the number of bytes used to store an integer data type.

On most modern systems (especially 32-bit and 64-bit architectures), an int typically occupies 4 bytes.

Therefore, the expression sizeof(int) generally evaluates to 4.

However, it is important to note that the exact size can vary depending on the compiler and system architecture, but 4 bytes is the most commonly expected answer in standard environments.