I just wrote a simple code.Since it have no warnings or error attentions from the VC compiler,it TOTALLY doesn't work!
What I wonder is whether the problem is due to the sequence of complying as well as how to figure it out.
------------------
Here is the code
#include<iostream>
using namespace std;
int fac(int n);
void main()
{
int m;
cout<<"Enter a number:\n";
cin>>m;
cout<<"\n"<<fac(m);
}
int fac(int n)
{
while(n!=1)
return n*fac(--n);
return 1;
}