#include <iostream>
using namespace std;
int factorial(int n1){
int r=1;
for (int c=n1; c>0; c–){
r=r*c;
}
return (r);
}
int main(){
int n;
char ans;
do{
cout << “Give me a non negative integer to give you its factorial: ” << endl;
cin >> n ;
cout << “The factorial of that number is : ” << factorial(n) << endl;
cout << “Do you want to know the factorial of another number? y/n ” << endl;
cin >> ans;
}while(ans==’y’);
cout << “Ok, have a nice day.” << endl;
return 0;
}