Advertisement
Guest User

Domashna 2

a guest
May 28th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. double a, b, i;
  9.  
  10. a = atof(argv[1]);
  11. b = atof(argv[2]);
  12. i = atof(argv[3]);
  13.  
  14. if (argc != 4)
  15. printf("Enter 4 arguments please");
  16. else{
  17. printf("a + b = :%.2lf\n", a + b);
  18. printf("a - b = :%.2lf\n", a - b);
  19. printf("a * a = :%.2lf\n", a * a);
  20. printf("b * b = :%.2lf\n", b * b);
  21. printf("sqrt(a*a + b*b) = %.5lf\n", sqrt(a * a + b * b));
  22. printf("a root of b is: %.5lf\n", pow(a, 1 / b));
  23. printf("b root of a is: %.5lf\n\n", pow(b, 1 / a));
  24.  
  25. printf("The value of sin(%.2lf) : %.5lf \n", i, sin(i));
  26. printf("The value of cos(%.2lf) : %.5lf \n", i, cos(i));
  27. printf("The value of tan(%.2lf) : %.5lf \n", i, tan(i));
  28. printf("The value of exp(%.2lf) : %.5lf \n", i, exp(i));
  29. printf("The value of sinh(%.2lf) : %.5lf \n", i, sinh(i));
  30. printf("The value of cosh(%.2lf) : %.5lf \n", i, cosh(i));
  31. printf("The value of tanh(%.2lf) : %.5lf \n", i, tanh(i));
  32. printf("The value of log(%.2lf) : %.5lf \n", i, log(i));
  33. printf("The value of log10(%.2lf) : %.5lf \n", i, log10(i));
  34.  
  35.  
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement