Guest User

Untitled

a guest
May 26th, 2010
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int ciclo;
  5. float n1;
  6. float n2;
  7. float somma;
  8.  
  9. main()
  10. {
  11. do
  12. {
  13. printf("1.Moltiplicazione\t2.Divisione\n");
  14. } while(1 || 2);
  15. switch(ciclo) {
  16. case '1':
  17. {
  18. printf("\nDigita il primo numero\n");
  19. scanf("%f", &n1);
  20. printf("\nDigita il secondo numero\n");
  21. scanf("%f", &n2);
  22. somma = n1 * n2;
  23. printf("\nIl risultato e : %f", somma);
  24. system("pause>nul");
  25. break;
  26. }
  27. case '2':
  28. {
  29. printf("\nDigita il primo numero\n");
  30. scanf("%f", &n1);
  31. printf("\nDigita il secondo numero\n");
  32. scanf("%f", &n2);
  33. somma = n1 / n2;
  34. printf("\nIl risultato e : %f", somma);
  35. system("pause>nul");
  36. break;
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment