#include <stdio.h>

int main(void)
{
 int principal, year; 
 float rate, money;


 printf("Input principal and interest rate: ");
 scanf_s("%d %f", &principal, &rate);


 for (year = 1; money <= 2 * principal; year++)
  printf("The total balance will exceed %f after %d years.", money, year);
 
}


void money(float money, int principal, float rate, int year)
{
 money = principal*(1 + rate*year);
 return money;
}


원금 이율 입력하면 몇년뒤에 원금이 2배로 나오는지 출력하는 코드인데 감이안잡혀요..