Â
In this, we are going to a program in which we can find the cosine of any angle entered in radians in C Programming Language.
//Displays cosine of the angle using functions
#include <stdio.h>
#include <math.h>
const double pi= 3.1415926535897;
int main()
{
double x,n;
printf("Enter the value of x : ");
scanf("%lf", &x);
n = x;
x = ((x * (pi/ 180.0)));
printf("cos(%0.2lf) = %lf", n,cos(x));
return 0;
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP