1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream> using namespace std; int factorialFinder(int x){ if(x==1){ return 1; }else{ return x*factorialFinder(x-1); } } int main() { cout << factorialFinder(5) << endl; }
1
120