Advertisement
PedroSG

Untitled

Apr 16th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.08 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main()
  4. {
  5.     int cat,R;
  6.     double a,b,c,X;
  7.     char SIM[20],NAO[20];
  8.     printf("Entre com o valor de A:");
  9.     scanf("%lf",&a);
  10.     printf("Entre com o valor de B:");
  11.     scanf("%lf",&b);
  12.     printf("Entre com o valor de C:");
  13.     scanf("%lf",&c);
  14.     do {
  15.             printf("Entre cum uma categoria:");
  16.             scanf("%d",&cat);
  17.              switch(cat)
  18.                 {
  19.                 case 1 :
  20.                     X = sin(a) + cos(b);
  21.                  break;
  22.                 case 2:
  23.                     X = tan(c) - cos(b);
  24.                  break;
  25.                 case 3:
  26.                     X = (cos(c) - tan(a)) / sin(b);
  27.                  break;
  28.                 case 4:
  29.                     X = sqrt((sin(a)* sin(a)) - 1);
  30.                  break;
  31.                 case 5:
  32.                     X = sqrt(cos(a)*sin(b));
  33.                  break;
  34.                 }
  35.              printf("X = %lf\n",X);
  36.              printf("Deseja continuar? SIM ou NAO\n");
  37.              scanf(" %s",&R);
  38.  
  39.     } while (R==SIM);
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement