fork download
  1. enum Color {
  2. RED,
  3. BLUE,
  4. GREEN
  5. }
  6.  
  7. int main() {
  8. Color color = BLUE;
  9. switch(color) {
  10. case RED:
  11. write("The color is red.\n");
  12. break;
  13. case BLUE:
  14. write("The color is blue.\n");
  15. break;
  16. case GREEN:
  17. write("The color is green.\n");
  18. break;
  19. default:
  20. write("Unknown color.\n");
  21. break;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0.05s 6496KB
stdin
Standard input is empty
stdout
The color is blue.