#include <stdio.h>
#include <math.h>
#define PI 3.1416
int
main (void)
{
double before, after, x, y, z;
before = -217.5;
after = ceil (before);
printf ("The ceiling of %3.1lf is %3.1lf\n", before, after);
before = -217.5;
after = floor (before);
printf ("The floor of %3.1lf is %3.1lf\n", before, after);
before = 200.0;
after = log (before);
printf ("The ln of %3.1lf is %3.1lf\n", before, after);
before = 200.0;
after = log10 (before);
printf ("The log of %3.1lf is %3.1lf\n", before, after);
before = 200.0;
after = sqrt (before);
printf ("The square root of %3.1lf is %3.1lf\n", before, after);
before = -413.56;
after = fabs (before);
printf ("The absolute value of %3.1lf is %3.1lf\n", before, after);
before = 45.0;
after = sin (before * PI / 180);
printf ("The sine of %3.1lf is %5.3lf\n", before, after);
before = 45.0;
after = cos (before * PI / 180);
printf ("The cosine of %3.1lf is %5.3lf\n", before, after);
before = 45.0;
after = tan (before * PI / 180);
printf ("The tangent of %3.1lf is %5.3lf\n", before, after);
before = 10.0;
after = exp (before);
printf ("e to the power of %3.1lf is %5.3lf\n", before, after);
x = 9.0; y = 3.0;
z = pow (x, y);
printf ("%3.1lf to the power of %3.1lf is %3.1lf\n", x, y, z);
return (0);
}
The ceiling of -217.5 is -217.0
The floor of -217.5 is -218.0
The ln of 200.0 is 5.3
The log of 200.0 is 2.3
The square root of 200.0 is 14.1
The absolute value of -413.6 is 413.6
The sine of 45.0 is 0.707
The cosine of 45.0 is 0.707
The tangent of 45.0 is 1.000
e to the power of 10.0 is 22026.466
9.0 to the power of 3.0 is 729.0