fork(1) download
  1. #include <stdio.h>
  2.  
  3. int deporte;
  4. main() {
  5.  
  6. printf("\n Introduce un número del 1 al 4, para probar suerte y decidir cuál podría ser tu deporte ");
  7. scanf("%d", &deporte);
  8.  
  9. switch(deporte) {
  10. case 1:
  11. printf("\n Podrías elegir fútbol");
  12. printf("\n");
  13. break;
  14. case 2:
  15. printf("\n Podrías elegir baloncesto");
  16. printf("\n");
  17. break;
  18. case 3:
  19. printf("\n Podrías elegir rugby");
  20. printf("\n");
  21. break;
  22. case 4:
  23. printf("\n Podrías elegir tenis");
  24. printf("\n");
  25. break;
  26. default:
  27. printf("\n Error, opcion incorrecta");
  28. break;
  29. }
  30. system("pause");
  31. }
Success #stdin #stdout #stderr 0.01s 5320KB
stdin
2








stdout
 Introduce un número del 1 al 4, para probar suerte y decidir cuál podría ser tu deporte 
 Podrías elegir baloncesto
stderr
sh: 1: pause: not found