what is FPE?
how do i correct this in my program....tried everything...:sad:
#include<iostream>
using namespace std;
int factorial(int a)
{int f=1;
for(int i=1;i<a+1;i++)
{
f*=i;
}
return f;
}
int main()
{
int factorial(int);
int n;cin>>n;int x=n/2,y=n%2,d,e,f,sum=0;
for(int i=0;i<n;i++)
{
d=factorial(x+y);f=factorial(y);
if(x==0)
{
e=1;
}
else
{
e=factorial(x);
}
if(y==0)
{
f=1;
}
else{
f=factorial(y);
}
sum=sum+(d/(e*f));x--;y=y+2;
}
cout<<sum;
}