/*write a c program to find value of cos(x) using the seies.*/ #include #include int main() { float x,sum,term,acc; int i; printf("\n Enter the value of x in degree:\n"); scanf("%f",&x); printf("\n Enter the value of accuracy:\n"); scanf("%f",&acc); x=3.14*x/180; sum=0; i=0; term=1; while(fabs(term)>=acc) { sum=sum+term; i=i+1; term=-term*x*x/((2*1)*(2*1-1)); } printf("\n cos(x)=%f",sum); printf("\n By using library function cos(x)=%f",cos(x)); return 0; }