#include
// define rec_power_2 function
int rec_power_of_2 (int n) {
if (n == 0)
return 1;
else
return 2 * rec_power_of_2(n-1);
}
//Test
main () {
cout << "2 to the power 0th power is " << rec_power_of_2(0) << endl
<< "2 to the power 1st power is " << rec_power_of_2(1) << endl
<< "2 to the power 2nd power is " << rec_power_of_2(2) << endl
<< "2 to the power 3rd power is " << rec_power_of_2(3) << endl
<< "2 to the power 17th power is " << rec_power_of_2(17) << endl;
}