#include #include // Must include math.h header. // To compile: // gcc math.c -lm int main () { double x = 1.5; double y = 2.0; printf ("x = %lf ceil(x) = %lf\n", x, ceil(x) ); // 2.0 printf ("x = %lf floor(x) = %lf\n", x, floor(x) ); // 1.0 printf ("x = %lf sqrt(x) = %lf\n", x, sqrt(x) ); // 1.224 printf ("x = %lf exp(x) = %lf\n", x, exp(x) ); // 4.481 printf ("x = %lf log(x) = %lf\n", x, log(x) ); // 0.405 x = -1.5; printf ("x = %lf fabs(x) = %lf\n", x, fabs(x) ); // 1.5 printf ("x = %lf y = %lf x^y = %lf\n", x, y, pow(x,y) ); // 2.25 }