Defines an enumeration type plus two variables. - C Data Type

C examples for Data Type:enum

Description

Defines an enumeration type plus two variables.

Demo Code

#include <stdio.h> 
int main(void) { 

  enum Weekday {Monday, Tuesday, Wednesday, Thursday,
                             Friday, Saturday, Sunday} today, tomorrow;

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

  return 0; /*from w  ww .java 2 s  .c  o  m*/
}

Related Tutorials