Syntax
#include <math.h> double cos(double x);Description
cos returns the cosine of x.
This example calculates y to be the cosine of x.
#include <math.h>
int main(void)
{
double x,y;
x = 7.2;
y = cos(x);
printf("cos( %lf ) = %lf\n", x, y);
return 0;
/****************************************************************************
The output should be:
cos( 7.200000 ) = 0.608351
****************************************************************************/
}
Related Information