enum c
snippet in c

enum c

user3405

// Changing default values of enum constants
enum suit {
    club = 0,
    diamonds = 10,
    hearts = 20,
    spades = 3,
};

enum c

user8199

#include <stdio.h> 
enum State {WORKING = 0, FAILED, FREEZED}; 
enum State currState = 2; 
  
enum State FindState() { 
    return currState; 
} 
  
int main() { 
   (FindState() == WORKING)? printf("WORKING"): printf("NOT WORKING"); 
   return 0; 
}