C Tutorial/math.h/cos
cos
Item Value Header file math.h Declaration float cosf(float arg);double cos(double arg);long double cosl(long double arg); Function returns the cosine of arg. Parameter arg must be in radians.
<source lang="cpp">#include <math.h>
#include <stdio.h> int main(void) { double val = -1.0; do { printf("Cosine of %f is %f.\n", val, cos(val)); val += 0.1; } while(val<=1.0); return 0; }</source>