Nested Sizeof Operator : C Interview Questions

February 20, 2025 No Comments » Hits : 58






Nested Sizeof Operator : C Interview Questions

  1. Nested Sizeof Operator is Allowed in C Programming Language.
  2. Sizeof Operator will gives us size of variable passed to the function.
  3. Innermost Sizeof operator will evaluate size of Variable “num” i.e 2 bytes
  4. Outer Sizeof will evaluate Size of constant “2″ .i.e 2 bytes

What will be the output of Following Program ?

main()
{
int num = 100;
clrscr();
printf("%d", sizeof(sizeof(num)));
}

Output :

2