//A program that calculates the amount of money in a bank account after n years
#include <stdio.h>
double bank(double money, double apy, int years);
int main() {
double money1, apy1;
int years1;
printf("How much money is currently in your bank account? ");
scanf("%d", &money1);
printf("How many years will this money stay in your account? ");
scanf("%d",&years1); 
printf("What is your APY? ");
scanf("%d", &apy1); 
int bank1 = bank(money1, apy1, years1);
printf("Your grand total after %d will be $%d \n", years1, bank1); 
system ("PAUSE");
return 0;   
}
double bank(double money, double apy, int years) {
 if(years <= 0) 
    return money;
 else
    return bank(money*apy, apy, years-1);
 }
 
     
     
     
     
    