Very good example of linear recursion using factorials.
But you could do it faster with non-recursive algorithm :
Code:
# include <iostream>
# include <cstdio>

using namespace std;

unsigned int factorial(int n)
{
  unsigned int p=1;
  for (unsigned int i=1;i<=n;i++)
    p*=i;
  return p;           
}

int main()
{
    int n;
    cin>>n;
    cout<<factorial(n)<<endl;
    system("pause");
    return 0;
}
But in this non-recursive algorithm you use more memory than in your
recursive case.
Very good tut anyway !