x= x * 3.1412 / 180;
/* changing x into radians */
sn = 1;
sum = x;
num = x;
den = 1;
i = 1;
while (i < n)
{
num = num * x * x;
den = den * (2 * i) * (2 * i +1);
sn = -sn;
sum = sum + (num/den) * sn;
i++;
}
printf(“Sin(%2.2f) = %f”, xx, sum);
}
Do'stlaringiz bilan baham: