/* e(x) = 1 + x + x2 / 2! + x3 / 3! + x4/ 4! --------- xn / n! */
ender x number 1
endre n number 2
out put 1.176000
pls correct it math
what type of math this pls tall me
#include
#include
#include
void main()
{
int fact();
float x, t, sum;
int i, n;
printf("\n Enter the Value of x & n:");
scanf("%f %d", &x, &n);
x = x * 3.14/180;
t = 1;
sum = 1;
for ( i = 1; i <= n; i++)
{
t = t * pow(x, i) / fact(i);
sum = sum + t;
}
printf("\n The Value of ex = %f \n", sum);
}
int fact( int n)
{
int i;
for ( i = 1; i <= n; i++)
fact *= i;
return fact;
}
2007-06-29
21:26:19
·
3 answers
·
asked by
robin j
1