Wednesday, October 6, 2010

C program to compute exponential series with nested for stattement

#include math.h
int main()
{
float x,e=0.0;
int i,j,f=1;
printf("Enter the value of x");
scanf("%f",&x);
for(i=0;i< 7;i++)
{
for(j=i;j>1;j--)
{
f=f*j;
}
e+=pow(x,i)/f;
f=1;
}
printf("%f",e);
getch();
}


No comments:

Post a Comment

Google+ Followers