#include <stdio.h>
#include <math.h>
/* Define doubling_time first */
double doubling_time (double r) {
  /* At this point, r's value is the rate expressed as a percentage */
  r = r / 100.0;
  /* Now r's value is the rate expressed as a fraction */
  r = log (2.0) / log (1.0 + r);
  /* Now r's value is the result of the doubling-time computation */
  return r;
}
/* Then, define main */
main ( ) {
     double r = 5.0;
     printf ("The value of r is %f.\n", r);
     printf ("The doubling time at twice that rate is %f.\n",
             doubling_time (r + r));
     printf ("The value of r is still %f.\n", r);
}
