Professional Documents
Culture Documents
Untitled
Untitled
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include<stdio.h>
void main ()
{
long fact;
long sum=0;
int i,N;
printf ("Enter the number N upto which you want to find the sum of the factorials
of the first N numbers: ");
scanf ("%d", &N);
for(i=1;i<=N;i++)
{
sum += factorial(i);
}
printf("The required sum = %ld",sum);
//return 0;
}