#include <stdio.h>
int fact(int n)
{
int i,fact=1;
for(i=1;i<=n;i++)
{
fact=fact*i;
}
return fact;
}
int SumOfFirstNterms(int n)
{
int sum=0,i;
for(i=1;i<=n;i++)
{
sum=sum+fact(i)/i;
}
return sum;
}
int main(void) {
int n,res;
res = SumOfFirstNterms(n);
printf("Sum Of First N terms is %d",res
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBmYWN0KGludCBuKQp7CglpbnQgaSxmYWN0PTE7Cglmb3IoaT0xO2k8PW47aSsrKQoJewoJCWZhY3Q9ZmFjdCppOwoJfQoJcmV0dXJuIGZhY3Q7Cn0KCmludCBTdW1PZkZpcnN0TnRlcm1zKGludCBuKQp7CglpbnQgc3VtPTAsaTsKCWZvcihpPTE7aTw9bjtpKyspCgl7CgkJc3VtPXN1bStmYWN0KGkpL2k7Cgl9CglyZXR1cm4gc3VtOwp9CmludCBtYWluKHZvaWQpIHsKCWludCBuLHJlczsKCXByaW50ZigiRW50ZXIgbjogIik7CglzY2FuZigiJWQiLCZuKTsKCXJlcyA9IFN1bU9mRmlyc3ROdGVybXMobik7CglwcmludGYoIlN1bSBPZiBGaXJzdCBOIHRlcm1zIGlzICVkIixyZXMpOwoJcmV0dXJuIDA7Cn0K