MCQ Practice Single Best Answer Topic: Union in C Language

Q What is the output of this C code?
    #include "stdio.h"
    union stu
    {
        int ival;
        float fval;
    };
    void main()
    {
        union stu r;
        r.ival = 5;
        printf("%d", r.ival);
    }

Question ID
#2675
Subchapter
Union in C Language
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 9
  • B Compile time error
  • C 16
  • D 5
Correct Answer: D

Explanation

5

Share This Question

Share this MCQ with your friends or study group.