OK...that's where I was going wrong. What you would want to do is to feed the deposit from each month into a (double/float) array. Then, have a separate array of the same length detailing how long the corresponding deposit has been in the bank for (integer array). Then use a while/for loop to work through and calculate the interest for each deposit into another array. Then add up the totals at the end.
Are you sure that you need to get that amount of interest? The reason I asked you to use simple numbers is that it is no longer impossible to work out the true value, and will make it easier to determine errors in your code/logic.