Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | Misc | Question 5

  • Last Updated : 28 Jun, 2021

Assume that the size of an integer is 4 bytes. Predict the output?

#include <stdio.h>
int fun()
    puts(" Hello ");
    return 10;
int main()
    printf("%d", sizeof(fun()));
    return 0;

(A) 4
(B) Hello 4
(C) 4 Hello
(D) Compiler Error

Answer: (A)

Explanation: sizeof() is an operator, not a function. It looks like a function though.

The operands of operators need not to be evaluated. That is why fun() is not called.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!