Write a program to add first seven terms of the following series using a for loop:
void main()
{
float d,a,b,c,e;
printf("\nEnter a value\n");
scanf("%f",&e);
a=0;
for(d=1;d<=e;d++)
{
for(b=d,c=1;b>0;b--)
c=c*b;
a=a+d/c;
}
printf("\nThe first %f terms of the following series is %f",e,a);
}
Subscribe to:
Post Comments (Atom)
I am studying let us c and your solutions have helped me a lot thank you very much
ReplyDelete