void deposit_interest(int month_deposit, int year)
{
double amount = month_deposit;
int i;
double = rate;
if (month_deposit < 100 && year < 5)
rate = 3.7;
else if (month_deposit < 100 && year >= 5)
rate = 4.3;
else if (month_deposit >= 100 && year < 5)
rate = 3.9;
else
rate = 4.6;
for(i = 1; i < year; i++){
amount *= ((100.0+rate)/100.0);
}
printf("%d 년\t매월 저축액: %d\t이율: %f\n" year, month_deposit, rate);
printf("원금: %f\t이자: %f \t 총수령액: %f\n", month_deposit*12*year, (amount-(month_deposit*12*year)), amount);
}
int main(){
deposit_interest(20,10);
return 0;
}
아래처럼 이율해서 20만원씩 10년 해서 작동시켜보고싶은데 안되거든 ㅠㅠ
어디다쓸려그러냐면
년도 5년미만 5년이상
금액
100미만 3.7% 4.3%
100이상 3.9% 4.6%
int main(void)
{
int salary;
int deposit;
printf("저축액을 입력하시오(만원): ");
scanf("%d", &salary);
printf("10년 동안의 저축액: %d\n", deposit);
return 0;
}
이거랑 연계할려고 ㅠㅠ 위에것만좀 고쳐줘 ㅠㅠ 변수크기 지정을 도통 못하겟어 ㅠㅠ 어디가꼬인거야? ㅠㅠ
제목은 요고 내용은 왜 반말이고
으잉;; 어어!!!! 형님 하트뿅뿅사랑해요
아됫다됫다 고마워!!!!