What does this function do? void one(const int n) { if (n > 0) one(n - 1); print("*"); if (n > 0) one(n - 1); } Pick a case where it is very easy to analyse. If n is zero, the two conditional statements if (n>0) one(n-1) do not happen, so one(0) just prints a single star always, regardless of circumstances. Now it is easy to analyse if n is one. When n=1, (n>0) is true, so one(1) is equivalent to one(0); print("*"); one(0); and we already know exactly what one(0) does, so one(1) prints three stars always, regardless of circumstances. Knowing what one(1) always does, we know that one(2) will be equivalent to one(1); print("*"); one(1); so one(2) prints seven stars always, regardless of circumstances. And similarly, we can work out exactly what one(n) does for any value of n, and with luck see the pattern. __________________________________________________________ Turning that reasoning inside out, we want to design a function that will work out the value of a to the power of b Work out a really simple case that we can answer without any work: anything to the power of zero is 1, so we can start out like that. int power(const int a, const int b) { if (b == 0) return 1; ... Now to build up on that fact one step at a time. if we know what a to-the-power-of 0 is, then a to-the-power-of 1 is just that times a. if we know what a to-the-power-of 1 is, then a to-the-power-of 2 is just that times a. if we know what a to-the-power-of 2 is, then a to-the-power-of 3 is just that times a. if we know what a to-the-power-of 3 is, then a to-the-power-of 4 is just that times a. or in other words, if you want to know what a to-the-power-of 4 is, work out a to-the-power_of 3, and multiply it by a. when you want to know what power(a, b) is: if b is zero you already know the answer is 1 otherwise find out power(a, b-1) and multiply that by a. int power(const int a, const int b) { if (b == 0) return 1; const int prev = power(a, b-1); return prev * a; } Presented with that function, you could work out what it does the same way as we did at the beginning for one... what is the easy case? when b is zero if you know what happens when b is zero, what also becomes an easy case? when b is one and so on Or You could do what the computer does, draw out the private little universes recording everything that a function knows, and just see what happens.