Home Segments Index Top Previous Next

224: Mainline

First, note that you can eliminate the need to call power_of_2 in the simple case in which the value of recursive_power_of_2's parameter is 0:

int recursive_power_of_2 (int n) { 
  if (n == 0) 
    return 1;  /**/ 
  else 
    return power_of_2 (n); 
}