-cos() is a function that are able to find the value of the cosine(trignometry function).
-It is predefined in math.h header file.
Syntax-
cos(angle)
program-
#include < stdio.h>
#include < math.h>
int main () {
double ans,val;
int ang;
printf("Enter angle\n");
scanf("%d",&ang);
val = 3.14159265/180;
ans= cos(ang*val);
printf("cos(%d) is %f",ang,ans);
return(0);
}
Enter angle
90
cos(90) is 0.000000
Enter angle
60
cos(60) is 0.500000