Advertisement
TWL148

sauce

Jul 8th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.     double interestRate;
  6.     int amount, principal, compoudPerYear, time;
  7.    
  8.     printf("compounding interest calculator by twl\n\n");
  9.     printf("input the principal:\n(amount of money invested)\n");
  10.     scanf("%p", &principal);
  11.     printf("input the interest rate in decimal:\n");
  12.     scanf("%lf", &interestRate);
  13.     printf("input the time in years\n");
  14.     scanf("%p", &time);
  15.     printf("imput the amount of times your investment compounds per year\n");
  16.     scanf("%p", &compoudPerYear);
  17.    
  18.     amount = (principal * (1.0+(interestRate / compoudPerYear)) ^ (compoudPerYear * time));
  19.    
  20.    
  21.    
  22.    
  23.     printf("%p", amount);
  24.     return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement