Skip to content

Commit

Permalink
Merge pull request #1403 from SoumalyaM/SoumalyaM-patch-1
Browse files Browse the repository at this point in the history
C program to calculate compound interest
  • Loading branch information
fineanmol committed Sep 30, 2022
2 parents 93c3a75 + e01d1fb commit 79f681b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Calculate Compound Interest.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
int main()
{
float principal, rate, year, ci;
printf("Enter principal: ");
scanf("%f", &principal);
printf("Enter rate: ");
scanf("%f", &rate);
printf("Enter time in years: ");
scanf("%f", &year);
ci = principal * ((pow((1 + rate / 100), year) - 1));
printf("Compound interest is: %f\n", ci);
return 0;
}

0 comments on commit 79f681b

Please sign in to comment.