#include <iostream>
usingnamespace std;
int Factorial (int a)
{
int result;
result = a;
int b=a;
for (a=1;a!=b;a++)
{
result = result * (b-a);
}
return result;
}
int main()
{
int value = 5;
cout << Factorial(value);
cin.get();
return 0;
}
and it works, I was really surprised, but what i want to know is if there is any function easier or this is the simplest one.