Programming Language Union in C Language Question #2691
Single Choice Not Set

QWhat is the output of this C code?

    #include <stdio.h>
    union p
    {
        int x;
        char y;
    };
    int main()
    {
        union p p, b;
        p.y = 60;
        b.x = 12;
        printf("%d\n", p.y);
    }

ID: #2691 Union in C Language 670 views
Question Info
#2691Q ID
Not SetDifficulty
Union in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Compile time error
  • B Depends on the compiler
  • C 60
  • D Undefined behaviour
Correct Answer

Explanation

60

Share This Question

Challenge a friend or share with your study group.