The task is to write a program which for given $a$ and $b$ returns what is the compound interest if the money put in the bank with the required compound interest in $a$ years increases by $b\%$.
I do not see how can I find the compound interest if I do not know the starting amount of money?
Could it be $(1+\frac{b}{100})^{a}$?
Increasing by $b\%$ means:
$$b=\frac{\text{Final Amount – Initial amount}}{\text{Initial amount}} \cdot 100\% \tag{1}$$
Now let final amount be $M_f$ and intial amount be $M_i$. substituiting this in $(1)$, we rewrite as
$$b=\frac{M_f-M_i}{M_i} \cdot 100\% $$ $$\implies \frac{M_i(100+b)}{100}= M_f \tag{2}$$ Now for a compound interest $r\%$ per year, for $a$ years, we get $M_f$ as:
$$M_f=M_i\left(1+\frac{r}{100}\right)^a$$
Substituting this in $(2)$, we get
$$\left(1+\frac{b}{100}\right)=\left(1+\frac{r}{100}\right)^a$$
$$\therefore r=100\left(\left(1+\frac{b}{100}\right)^{1/a}-1\right)$$
However you are correct in the fact you can't find the value of $M_f$ if you do not know $M_i$. You get $r$ only.