Skip to content

Commit 6df96bc

Browse files
Create Calculate Compound Interest
1 parent 64d7d96 commit 6df96bc

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Calculate Compound Interest

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <stdio.h>
2+
#include <math.h>
3+
4+
int main()
5+
{
6+
float principal, rate, year, ci;
7+
8+
printf("Enter principal: ");
9+
scanf("%f", &principal);
10+
11+
printf("Enter rate: ");
12+
scanf("%f", &rate);
13+
14+
printf("Enter time in years: ");
15+
scanf("%f", &year);
16+
17+
//calculate compound interest
18+
19+
ci=principal*((pow((1+rate/100),year)-1));
20+
21+
printf("Compound interest is: %f\n",ci);
22+
23+
return 0;
24+
}

0 commit comments

Comments
 (0)