[ create a new paste ] login | about

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

C++, pasted on Jan 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 sum(int a, int b);
 
int main()
{
        int x, y;
        x =-5; y = 9;
        cout << sum(x, y) << endl;
}
 
int sum(int a, int b)
{
        if (a == 0)
                return b;
        else
        return sum(a - 1, b + 1);
}


Output:
1
Timeout


Create a new paste based on this one


Comments: