Guest User

Untitled

a guest
Dec 13th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5. float x, y;
  6. int z;
  7.  
  8. printf("Digite primeiro numero:");
  9. scanf("%f", &x);
  10.  
  11. printf("nDigite segundo numero:");
  12. scanf("%f", &y);
  13.  
  14. printf("nDigite a operação que deseja fazern");
  15. printf("n(1)Soma; (2)Subtração; (3)Multiplicação; (4)Divisãon");
  16. scanf("%d", &z);
  17.  
  18. switch(z){
  19.  
  20. case 1:
  21. printf("%2.f", x + y);
  22. break;
  23.  
  24. case 2:
  25. printf("%2.f", x - y);
  26. break;
  27.  
  28. case 3:
  29. printf("%2.f", x * y);
  30. break;
  31.  
  32. case 4:
  33. printf("%2.f", x / y);
  34. break;
  35.  
  36. default:
  37. printf("Número Inválido");
  38. break;
  39. }
  40.  
  41. return 0;
  42. }
Add Comment
Please, Sign In to add comment