C Program to Find Sum of the Series 1/1! + 2/2!+ ……1/N!

C Program to Find Sum of the Series post providing implementation program that is used to find the sum of specified series in the above using C language syntax C Program to Find Sum of the Series.

#include <stdio.h>
void main()
{
int n, i;
double sum=0, f=1;
printf(“Enter max value : “);
scanf(“%d”, &n);
for (i=1 ; i<=n ; i++)
{
f = f * i;
sum = sum +(i / f);
if (i == n)
printf(” (1 / %d!)”, i);
else
printf(” (1 / %d!) + “, i);
}
printf(” = %lf “, sum);
}

 

Share this