#include int power(const int a, const int b) { if (b == 0) return 1; const int prev = power(a, b-1); return prev * a; } void table(const int val, const int last) { // to print out a table of powers all the way from val to last: // if the table is to be empty, don't do anything if (val > last) return; // first print out the first line of the table // val, 2 to the power of val, 10 to the power of val print(val); print("\t"); print(power(2, val)); print("\t"); print(power(10, val)); print("\n"); // then do the same, but starting from the next value table(val+1, last); } void main() { table(1, 100); }