Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*calculate compound interest*/
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- float principle,time,rate,CI;
- printf("Enter principle (amount):\n");
- scanf("%f",&principle);
- printf("Enter time: \n");
- scanf("%f",&time);
- printf("Enter rate: \n");
- scanf("%f",&rate);
- CI=principle*pow((1+rate/100),time);
- /*compound interest =principle*pow((1+rate/100),time)*/
- printf("Compound Interest = %.2f",CI);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement