Series of factorial
#include
#include
void main()
{
float x,Sum,t;
int i;
clrscr();
printf("Value of X in degrees=");
scanf("%f",&x);
x=x*3.14/180;
Sum=x;
t=x;
i=1;
label:i=i+2;
t=(-t)*x*x/(i*(i-1));
if (fabs(t)>0.00001)
{
Sum=Sum+t;
goto label;
}
else
printf("sinx=%f\n",Sum);
getch();
}
Comments (0)
Post a Comment