Vidyalelo
C Programming · Q9

Operators and Expressions

Programming · C Programming · question 9

Q9

What does the sizeof operator return in C?

A.
Size of an array
B.
Size of a variable
Answer
C.
Size of a pointer
D.
Size of a function

Answer: Option B

Solution

Answer: Option B
Solution:
In C, the sizeof operator returns the size in bytes of the data type or variable provided as its operand. It is often used to determine the amount of memory occupied by a variable or data type.

Option A (Size of an array) is incorrect because sizeof returns the size of the data type or variable, not specifically for arrays.
Option C (Size of a pointer) is partially correct; sizeof can be used to determine the size of a pointer data type or a variable, but it is not limited to just pointers.
Option D (Size of a function) is incorrect because sizeof does not apply to functions in C.