/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
float capital (float n, int d, int a)
{
if (a == 0)
{
return n;
}
else
{
float monto = n * (1 + d / 100.0);
return capital (monto, d, a - 1);
}
}
int main ()
{
cout << capital (5000.0, 10, 3);
return 0;
}