Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. float a, b, c;
  5.  
  6. void soma(void)
  7. {
  8.    printf("Digite os dois numeros para a operacao\n");
  9.    scanf("%f%f",&a,&b);
  10.  
  11. }
  12.  
  13. int main()
  14. {
  15.    int operacao;
  16.  
  17.    printf("Digite 1 para somar\n");
  18.    scanf("%d",&operacao);
  19.  
  20.    switch(operacao)
  21.    {
  22.        case 1:
  23.           soma();
  24.           c = a + b;
  25.           printf("O resultado e: %f/n", c);
  26.           break;
  27.        default:
  28.           printf("Voce é idiota ou não sabe ler??? \n\n");
  29.           break;
  30.    }
  31.    system("pause");
  32.    return 0;
  33. }
Add Comment
Please, Sign In to add comment