C Programming - Structures, Unions, Enums - Discussion

Discussion Forum : Structures, Unions, Enums - Find Output of Program (Q.No. 6)
6.
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;
}
0, 1, 2
1, 2, 3
0, 2, 1
1, 3, 2
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
24 comments Page 3 of 3.

Amit said:   1 decade ago
@Manu. It is compiler dependent.

Naty said:   7 years ago
Thanks for the explanation @XYZ.

Jayshri said:   7 years ago
Thank you all.

Sadddd said:   1 decade ago
Good !


Post your comments here:

Your comments will be displayed after verification.