The Taylor series in calculus calculates values of different functions, given is the exponential function, for any x given by user, expand this series till 10 terms using loop to find the appropriate result of
#include<stdio.h>
void main()
{
int a,m,g=1,omi=1,count=1;
printf("enter ur fav no\n");
scanf("%d",&a);
for(m=1;m<=10;m++)
{
count=count+(g/omi);
g=g*a;
omi=omi*m;
}
printf("%d",count);
}
No comments:
Post a Comment