+ 2
What is enum in c
Explain breif
2 ответов
+ 8
Enum is used to assign integral constants. enum name{me,you,us}
+ 4
enumerator is a user define data type.
syntax:
enum identifier { v1, v2, .....,vn} ;
we can write any program in c language without the help of enum but,
enum helps in writing clear codes and simplify programing.
example:
include<stdio.h>
enum week{Mon=1, Tue, Wed, Thur, Fri, Sat, Sun};
int main()
{
enum week day;
day = Fri;
printf("%d",day);
return 0;
}
Output: 5