Write a program to add first seven terms of the following series using loop 1/1!+2/2!+3/3!+…
Here is the c source code/program for: Write a program to add first seven terms of the following series using loop 1/1!+2/2!+3/3!+…
/* write a program to add first seven series using for loop
programmed by:
Name: Jitendra kumar Yadav
Roll: 16
Date: 12 feb 2011 */
#include <stdio.h>
#include <conio.h>
void main()
{
int i;
int fact=1;
float sum=0;
for(i=1; i<=7; i++)
{
fact=fact*i;
sum=sum+(i*1.00/fact);
}
printf(“%f”,sum);
getch();
}
Comments (1)