View Code of Problem 73

#include<iostream>
using namespace std;

int peach(int n)
{
  if(n==1) 
    return 1;
  else
    return 2*peach(n-1)+2;
}

int main(void)
{
  int n,sum;
  cin>>n;
  sum=peach(n);
  cout<<sum;
}

Double click to view unformatted code.


Back to problem 73