:) My mind went blank for a bit and I couldn't figure out such a simple programme. But then I had a shower and all was well :)
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int factorial(int i = 1);
int main()
{
int num = 0;
bool quit = false;
while(!quit)
{
cout << "Enter number to factorise: ";
cin >> num;
num = (int)fabsf((float)num);
if (num > 10)
{quit = true;}
cout << factorial(num);
cout << endl;
}
}
int factorial(int i){
int fact = 1;
for(int j = 1; j < i + 1; j++)
{
fact *= j;
}
return fact;
}