[ create a new paste ] login | about

Link: http://codepad.org/kJ99rYKw    [ raw code | output | fork ]

C++, pasted on Mar 9:
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;


}


Output:
1
120


Create a new paste based on this one


Comments: