use while loop and ++ operator.writw 'C' programe.
Inpet real no. x reoresent degree convert it intc radiance.find sum of sin(r)by using cosine series.?
#define PI 3.142857
main()
{ int x,fact,i,sign=1;
float sum,rad;
printf("Enter x value:");
scanf("%d",%26amp;x);
rad=(x*(PI)/180); /*converting degrees into radians*/
i=1;
fact=1;
sum=1;
do{
sum+=(sign*(rad/fact));
i+=2;
rad*=rad*rad;
fact=fact*(i)*(i-1);
}while(i%26lt;=10);
printf("%f",sum);
}
Reply:I don't know what you are saying.
daisy
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment