Advertisement
paulogp

enum

Jul 19th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. // title: enum
  2. // ide: apple xcode
  3. // author: paulogp
  4.  
  5.  
  6. #include <stdio.h>
  7.  
  8. enum the_week_days {segunda, terca, quarta, quinta, sexta, sabado, domingo};
  9.  
  10. int main (int argc, const char * argv[])
  11. {
  12.     int the_day_a = segunda;
  13.    
  14.     the_day_a++;
  15.    
  16.     if (the_day_a == terca)
  17.     {
  18.         printf("terca-feira\n");
  19.     }
  20.    
  21.     the_day_a++;
  22.    
  23.     if (the_day_a == quarta)
  24.     {
  25.         printf("quarta-feira\n");
  26.     }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement