Write a C program to find the sum of the series 1+ 1/2! +1/3! + 1/4! +..............+ 1/n!
#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;
}