[ create a new paste ] login | about

Link: http://codepad.org/FUzWlOe2    [ 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
17
18
19
#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;


}

return 0;
}


Output:
1
2
Line 18: error: expected unqualified-id before 'return'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: