Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- double interestRate;
- int amount, principal, compoudPerYear, time;
- printf("compounding interest calculator by twl\n\n");
- printf("input the principal:\n(amount of money invested)\n");
- scanf("%p", &principal);
- printf("input the interest rate in decimal:\n");
- scanf("%lf", &interestRate);
- printf("input the time in years\n");
- scanf("%p", &time);
- printf("imput the amount of times your investment compounds per year\n");
- scanf("%p", &compoudPerYear);
- amount = (principal * (1.0+(interestRate / compoudPerYear)) ^ (compoudPerYear * time));
- printf("%p", amount);
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement