Advertisement
Tahamina_Taha

calculate compound interest

Jul 21st, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. /*calculate compound interest*/
  2. #include<stdio.h>
  3. #include<math.h>
  4. int main()
  5. {
  6.     float principle,time,rate,CI;
  7.     printf("Enter principle (amount):\n");
  8.     scanf("%f",&principle);
  9.     printf("Enter time: \n");
  10.     scanf("%f",&time);
  11.     printf("Enter rate: \n");
  12.     scanf("%f",&rate);
  13.     CI=principle*pow((1+rate/100),time);
  14. /*compound interest =principle*pow((1+rate/100),time)*/
  15.     printf("Compound Interest = %.2f",CI);
  16.     return 0;
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement