Advertisements

Search results for enum

Example:[1]

            Write a c program to find the current day of the week using enum.
          

            #include <stdio.h>
int CheckDay();
enum week
{
    sun=1,mon,tue,wed,thu,fri,sat
};
int main()
{
    int s;
    s = CheckDay();
    printf("Today is %dth day of the week\n",s);
    return 0;
}
int CheckDay()
{
    enum week today;
    today = wed;
    return today;
}
          

 Search Links


 Popular C search MCQs


 Popular C search examples