#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("\nTHE FACTORIAL VALUE IS %ld the sum is %ld",fact,sum);
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
********************************************************* NAME:NAYAN SHAH
ROLL NO: 48
SEMISTER: 1
DEFINATION: WRITE A PROGRAM TO FIND ANSWER OF THE FOLLOWING SERIES.
INPUT STEPS FROM KEYBOARD.
1 + 2 + 6 + 24 + 120 + ......
#include<stdio.h>
#include<conio.h>
void main()
{
long int 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();
}
*/