C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - Find Output of Program (Q.No. 5)
5.
What will be the output of the program ?
#include<stdio.h>
int main()
{
enum days {MON=-1, TUE, WED=6, THU, FRI, SAT};
printf("%d, %d, %d, %d, %d, %d\n", MON, TUE, WED, THU, FRI, SAT);
return 0;
}
Discussion:
31 comments Page 4 of 4.
ANIL B RATHOD said:
2 years ago
Enums are always integral constants so we call enums as names of an integer value.
Enums will assign the values to its member automatically starting from 0 (zero). And next to increasing the variable, we have to increase the value explicitly.
Enums will assign the values to its member automatically starting from 0 (zero). And next to increasing the variable, we have to increase the value explicitly.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers