I think you should do similar like this.
#include<stdio.h>
#include<conio.h>
int fact(int n)
{
if(n == 0)
{
return 1;
}
return n * fact(n-1);
}
void main()
{
int sum = 1, delta = -1;
for(int i=2; i<=n; ++i)
{
sum += ((i / fact(i + 1)) * delta);
delta *= -1;
}
printf("the sum=%d",sum);
}
I didn't compile the above code. But I think it would help you.