Answer to Question #24573 in Action Script | Flash | Flex | ColdFusion for Ladarva
Write a C program to find the sum of the series 1+ 1/2! +1/3! + 1/4! +..............+ 1/n!
1
2013-02-19T08:32:23-0500
#include <stdio.h>
int main()
{
printf("Enter n:\n");
unsigned n=0;
do
{
scanf( "%d", &n);
}
while ( n==0 );
double fact=1;
double sum=0;
int i;
for ( i=1; i<=n; ++i )
{
fact=fact/i;
sum=sum+fact;
}
printf( "Sum=%f\n", sum);
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
Adobe Flash
Comments
You're welcome. We are glad to be helpful. If you really liked our service please press like-button beside answer field. Thank you!
Thank u vry mch.....it works!!!!!!!!!!!!!!
Leave a comment