math.h functions in c

math.h header file does some mathematical calculations. we can use this function in mathematical program. we will see one program with the below functions

MAth functions in c

example:

#include
#include
main()
{
int x=5,y=6;
printf("the square root of 5 is %5.2f \n",sqrt(x));
printf("the sin value of 5 is %5.2f \n",sin(x));
printf("the cos value of 5 is %5.2f \n",cos(x));
printf("the tanvalue of 5 is %5.2f \n",tan(x));
printf("the log value of 5 is %5.2f \n",log(x));
printf("the square root of 5 rounded up to nearest number is %5.2f",ceil(sqrt(x)));
printf("the absulate value of 5 is %5.2f \n",fabs(x));
printf("the remainder after divind x with y is %5.2f \n",fmod(x,y));
printf("the square root of 5 rounded down to nearest number is %5.2f",floor(sqrt(x)));
printf("the value of 5 power 6is %5.2f \n",pow(x,y));
}

output:

the square root of 5 is 2.24
the sin value of 5 is -0.96
the cos value of 5 is 0.28
the tanvalue of 5 is -3.38
the log value of 5 is 1.61
the square root of 5 rounded up to nearest number is 3.00the absulate value of
5 is 5.00
the remainder after divind x with y is 5.00
the square root of 5 rounded down to nearest number is 2.00the value of 5 powe
r 6is 15625.00