#include<stdio.h>
#include<conio.h>
void main()
{
longint fact=1,i,n,sum=0;
clrscr();
printf("\n ENTER THE VALUE OF N: ");
scanf("%ld",&n);
printf("\n THE SERIES IS ");
for(i=1;i<=n;i++)
{
fact = fact * i;
if(i==n)
printf(" %ld",fact);
else
printf("%ld + ",fact);
sum = sum + fact;
}
printf("\n**************************************");
printf("\nTHE FACTORIAL VALUE IS %ld the sum is %ld",fact,sum);
printf("\n**************************************");
getch();
}
********************************* OUTPUT ***********************
ENTER THE VALUE OF N: 5
THE SERIES IS 1 + 2 + 6 + 24 + 120
THE FACTORIAL VALUE IS 120 the sum is 153
****************************************************************