2 * Exponentiation using recursion
4 * Luiz Fernando N. Capitulino
5 * <lcapitulino@gmail.com>
10 double expr(int base
, int n
)
14 return (base
* expr(base
, n
- 1));
17 int main(int argc
, char *argv
[])
22 printf("expo < base > < exponent>\n");
30 fprintf(stderr
, "error: the exponent must be positive\n");
34 printf("%d exp %d = %.1f\n", base
, expo
, expr(base
, expo
));