//W.A.P TO SOLVE THE FOLLOWING: 1!+2!+3!+4!+5!+_______+n TERMS
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
unsigned long sum=0,f,n;
int i,j,k;
cout<<"\n Enter the number of terms:";
cin>>n;
for(k=1,i=1;i<=n;i++,k+=1)
{
f=1;
for(j=1;j<=k;j++)
f*=j;
sum+=f;
}
cout<<"\n sum of factorial series is="<<sum;
getch();
}
