Question: Program -

Function that accepts current year and the birth year, computes the age 

The problem -

Program crashes

The code-

```
int Age(int curr,  int birth)
{
if (curr > birth)
{
    return  1 + Age(curr--, birth);
}
return 0;
}

```

the input in function main is:

```
printf ("%d\n", Age(2014,1989)); 

```

Thanks for the help

Answer: 
It should be

```
... Age(--curr, birth);

```

as `curr` shall be decremented before `Age()` is being called.

Using `curr--` decrements `curr`  The decrement applied to `curr` by `curr--` takes effect after `Age()` returned, which will never happen, as the programm runs into a stack overflow due to trying infinit recursion.
I guess this could be simply done as

```
age = curr-birth-1

```

without worrying about recursion.