MCQ Practice Single Best Answer Topic: Union in C Language

Q What will be the output of the program?

#include<stdio.h>

int main()
{
    enum status {pass, fail, absent};
    enum status stud1, stud2, stud3;
    stud1 = pass;
    stud2 = absent;
    stud3 = fail;
    printf("%d %d %d\n", stud1, stud2, stud3);
    return 0;
}

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

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 0, 1, 2
  • B 1, 2, 3
  • C 0, 2, 1
  • D 1, 3, 2
Correct Answer: C

Explanation

0, 2, 1

Share This Question

Share this MCQ with your friends or study group.