C-study/02-1/3/3.c

13 lines
268 B
C
Raw Permalink Normal View History

2021-09-29 07:15:39 +00:00
#include<stdio.h>
#include<math.h>
int main()
{
float money,year,rate,interest;
printf("Enter money,year and rate: \n");
scanf("%f %f %f",&money,&year,&rate);
interest = money * pow((1 + rate), year) - money;
printf("interest=%.2f",interest);
return 0;
}