Answers for "enum function in c"

C
6

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
Posted by: Guest on April-28-2020
3

how to define a enum in c

//enum <name of enumeration> { <possible choices separated by commas> } 
enum type_of_fuel{ Gasolina, Gasoleo, Hibrido, Eletrico};
Posted by: Guest on July-07-2020
2

enum c

// Changing default values of enum constants
enum suit {
    club = 0,
    diamonds = 10,
    hearts = 20,
    spades = 3,
};
Posted by: Guest on March-14-2020
0

enum function 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
Posted by: Guest on March-22-2021

Code answers related to "C"

Browse Popular Code Answers by Language