Enum Values In C Code Example


Example 1: a enum data type in c

// An example program to demonstrate working  // of enum in C  #include<stdio.h>     enum week{Mon, Tue, Wed, Thur, Fri, Sat, Sun};     int main()  {      enum week day;      day = Wed;      printf("%d",day);      return 0;  }   // OUTPUT 2

Example 2: how to define a enum in c

//enum <name of enumeration> { <possible choices separated by commas> }  enum type_of_fuel{ Gasolina, Gasoleo, Hibrido, Eletrico};

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable