cpp recursionRecursion: Functions that call themselves

Recursion: Functions that call themselves

Learn C++ in step-by-step lessons.


Recursion is when a function calls itself. For recursion to work there has to be a trivial case where the recursion ends.

Try to identify the trivial case in each example.


Please study the material at each of the links below.

  1. Understanding recursion Understanding recursion
  2. Find half of a number recursively
  3. The Towers Problem The Towers Problem
  4. Fibonacci Sequence
GlossaryGlossary for recursion lesson
Full Glossary