Initialize the variable for an enumeration type - C Data Type

C examples for Data Type:enum

Description

Initialize the variable for an enumeration type

Demo Code

#include <stdio.h> 
int main(void) { 
  enum Weekday {Monday, Tuesday, Wednesday, Thursday,
                Friday, Saturday, Sunday} today = Monday, tomorrow = Tuesday;  

  printf("Weekday created\n");
  
  printf("%d\n",today);
  printf("%d",tomorrow);

  return 0; // ww w .  ja v  a  2s.c  o  m
}

Result


Related Tutorials