Advertisement
adventuretimeh

istruzione con switch

Jan 7th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. int main(int argc, char *argv[]) {
  7. int stato;
  8. printf("semaforo");
  9. scanf("%d",&stato);
  10. switch(stato)
  11. {
  12. case1:
  13. printf("stop");
  14. break;
  15. case2:
  16. printf("rallento");
  17. break;
  18. case3:
  19. printf("vado");
  20. break;
  21. default:
  22. printf("attenzione");
  23. }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement