# Math Functions

/*This program will demonstrate how to use math functions, It
includes square roots, absolute values, exponents, and the
greatest and least integer functions.*/

```#include <stdio.h> printf and scanf
#include <math.h> // for sqrt, abs, fabs, ceil, and floor
main()
{
int j =16;
int a, b, c;
float nk = -2.7;
float r, m;

j = sqrt (j); // square root of j
printf("***%5i###\n",j);

m = abs (16); // absolute value of an integer
nk = fabs (nk); // absolute value of a float
printf("%5.3f****%3i",nk,j);

r = pow(2,3); // 2 to the 3rd

printf("AAA%3.2fZZZ\n",r);

a = ceil (2.5); // ceiling function or least integer function
b = ceil (2);   // will be the least integer greater than
c = ceil (-2.7);// than the aurgument
printf("**%3i**%4i***%3i\n",a,b,c);

a = floor (2.5); // floor function or greatest integer function
b = floor (2);   // will be the greatest integer less than
c = floor (-2.7);// than the aurgument
printf("**%3i**%4i***%3i",a,b,c);

return 0;
}
/*
***    4###
2.700****  4AAA8.00ZZZ
**  3**   2*** -2
**  2**   2*** -3
*/
```