Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(int argc, char *argv[])
- {
- double a, b, i;
- a = atof(argv[1]);
- b = atof(argv[2]);
- i = atof(argv[3]);
- if (argc != 4)
- printf("Enter 4 arguments please");
- else{
- printf("a + b = :%.2lf\n", a + b);
- printf("a - b = :%.2lf\n", a - b);
- printf("a * a = :%.2lf\n", a * a);
- printf("b * b = :%.2lf\n", b * b);
- printf("sqrt(a*a + b*b) = %.5lf\n", sqrt(a * a + b * b));
- printf("a root of b is: %.5lf\n", pow(a, 1 / b));
- printf("b root of a is: %.5lf\n\n", pow(b, 1 / a));
- printf("The value of sin(%.2lf) : %.5lf \n", i, sin(i));
- printf("The value of cos(%.2lf) : %.5lf \n", i, cos(i));
- printf("The value of tan(%.2lf) : %.5lf \n", i, tan(i));
- printf("The value of exp(%.2lf) : %.5lf \n", i, exp(i));
- printf("The value of sinh(%.2lf) : %.5lf \n", i, sinh(i));
- printf("The value of cosh(%.2lf) : %.5lf \n", i, cosh(i));
- printf("The value of tanh(%.2lf) : %.5lf \n", i, tanh(i));
- printf("The value of log(%.2lf) : %.5lf \n", i, log(i));
- printf("The value of log10(%.2lf) : %.5lf \n", i, log10(i));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement