Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | Operators | Question 21

  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021

Assume that the size of an integer is 4 bytes, predict the output of following program.

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 main()
{
    int i = 12;
    int j = sizeof(i++);
    printf("%d  %d", i, j);
    return 0;
}

(A) 12 4
(B) 13 4
(C) Compiler Error
(D) 0 4


Answer: (A)

Explanation: The expressions written inside sizeof are not evaluated, so i++ is not performed.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :