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?

Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.




#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!