//* Recursive functions *

#include <stdio.h> #include <stdlib.h> unsigned long int factorial(unsigned long int n) // __reentrant { unsigned long int partial; // this function is written using excessive unsigned long int result = 1; // number of instructions in order to emulate if (n>1) // a more complex real life function that { // needs to use several parameters and/or partial = factorial(n-1); // local variables so that the register-based result = n * partial; // local variable space is exhausted } return(result); }