[ create a new paste ] login | about

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

johannes - C++, pasted on Aug 2:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream.h>

void count(int n)
{
    std::cout << "Counting: " << n << "\n";
    if (n < 5) {
        count(n+1);
    }
}

int main(int argc, char **argv)
{
    count(1);
    return 0;
}


Output:
1
2
3
4
5
Counting: 1
Counting: 2
Counting: 3
Counting: 4
Counting: 5


Create a new paste based on this one


Comments: