/* Write a program to add first seven terms of the following series using a
for loop.
    1 / 1! + 2 / 2! + 3 / 3! + ...
*/
/* Let Us C, Chap - 6, Page - 102, Problem 6.2 */

#include <stdio.h>
#define N 7 // update N here

int main()
{
    double sum = 0; int fact = 1;
    for (int i = 1; i <= N; i++)
    {
        fact *= i;
        sum += (double)i / fact;
    }
    printf("Sum of the series : %g", sum);
    return 0;
}
