Declare a variable of type Weekday and initialize it. - C Data Type

C examples for Data Type:enum

Description

Declare a variable of type Weekday and initialize it.

Demo Code

#include <stdio.h> 
  
int main(void) 
{ 
    enum Weekday {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday};  
    //from w  w  w  .  jav a 2s .c  o  m
    enum Weekday today = Wednesday;
    
    printf("Weekday created\n");
  
    printf("%d\n",today);
    

    return 0; 
}

Result


Related Tutorials