Typedef Enum

code:

#include<stdio.h>
typedef enum
{
    SUN,MON,TUES,WED=70,THURS=80,FRI,SAT
} days_of_week;
typedef enum
{
    FALSE,TRUE
}Boolean;

Boolean isEven(int n){
    if(n%2==0)
        return TRUE;
    else
        return FALSE;
}

int main()
{
    days_of_week day=FRI;
    if(day==FRI || day==SAT) //much comprehensive
        printf("Holiday\n");
    else
        printf("Not holiday\n");

    printf("Value of sun is: %d\n",SUN);



    return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published.