Advertisement
tinocodavi

tinoco

Aug 20th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5. int op;
  6. float n1,n2,soma,sub;
  7.  
  8. printf("menu de opoçoes");
  9. printf("1-somar dois numeros:\n" );
  10. printf("2-subtrair dois numeros:\n" );
  11.  
  12. if (op==1)
  13. {
  14. printf("informe dois numeros para calcular a soma:\n");
  15. scanf("%f %f",&n1,&n2);
  16.  
  17. soma=n1+n2;
  18.  
  19. printf("o resultado é: %f",soma);
  20. }
  21. else
  22. {
  23. printf("informe dois numeros para calcular a subtração:\n");
  24. scanf("%f %f",&n1,&n2);
  25.  
  26. sub=n1+n2;
  27.  
  28. printf("o resultado é: %f",sub);
  29. }
  30. System ("pause");
  31. return (0);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement