Advertisement
schreiberstein

compilation_case

Aug 4th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.17 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void exit( int exit_code );
  4.  
  5. void turtles() {
  6.    
  7.     int turtles = 10;
  8.     printf("\n 10 zombie turtles are flying through the air. \n");
  9.    
  10.     while (turtles > 2) {
  11.         turtles--;
  12.         printf("\n %i zombie turtles are flying through the air. Alex came and 1 turtle flew away :-(", turtles);
  13.     }
  14.    
  15.     turtles--;
  16.     printf("\n %i zombie turtle is flying through the air. Alex came and the turtle flew away :-(", turtles);
  17.     printf("\n \n NO MORE ZOMBIES! \n");
  18.     exit(0);
  19.    
  20. }
  21.  
  22. void counter() {
  23.  
  24.     int zahl = 0;
  25.    
  26.     printf("\n");
  27.     while (zahl < 100) {
  28.         zahl++;
  29.         printf("\n %i \n", zahl);
  30.     }
  31.            
  32.     exit(0);
  33. }
  34.  
  35. int main() {
  36.  
  37.     int input;
  38.     printf("Choose a boring function, please!\n");
  39.     printf("1 : Zombie Turtles \n");
  40.     printf("2 : useless counter \n");
  41.     printf("3 : NOT IMPLEMENTED YET! \n");
  42.     printf("4 : EXIT! \n");
  43.     scanf("%i", &input);
  44.     switch (input) {
  45.         case 1:
  46.             turtles();
  47.            
  48.         case 2:
  49.             counter();
  50.            
  51.         case 3:
  52.             printf("\nLOL!!!!!!\n\n");
  53.             exit(0);
  54.            
  55.         case 4:
  56.             exit(0);
  57.        
  58.         default:
  59.             printf("\nINVAILD! Stop that BASTARD! \n");
  60.                    exit(0);
  61.     }
  62.    
  63.                    printf("You'll never see this message!");
  64.     return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement