You should use the datatype float or double for such operation to get a mathematical precision.
Rethink the strategy of calculating the amount. I know it as empowering the added rate for years. If the rate is in percent you must divide by 100. (As I coded).
Your time input is used. That you must solve for yourself.
float principal, rate, time, n, a;a = principal*pow(1+rate/100,n);
Maybe you add a hint that the input can have some fracton seperated with a "."