id returned 1 exit status!
long func(const int &data);int main()
{
int a1=5;
long sum;
sum=func(a1);
cout<<a<<"\t"<<sum<<endl;
return 0;
}
long func(const int &data)
{
int s=data-1;
if(s<1)
return 1;
else
return data*func((s));
}
#include <iostream> using std::cout; using std::endl; long func(const int &data); int main(void) { int a1 = 5; long sum; sum = func(a1); cout << a1 << "\t" << sum << endl; return 0; } long func(const int &data) { int s = data - 1; if (s < 1) return 1; else return data * func((s)); }