fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. float p, r, t, ci;
  7.  
  8. printf("Enter the principle :");
  9. scanf("%f", &p);
  10. printf("Enter the rate :");
  11. scanf("%f", &r);
  12. printf("Enter the time :");
  13. scanf("%f", &t);
  14.  
  15. ci = p * pow((1 + r / 100), t) - p;
  16.  
  17. printf("\nThe compound interest is %0.2f", ci);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5276KB
stdin
35
43
67
stdout
Enter the principle :Enter the rate :Enter the time :
The compound interest is 894507352064.00