C Program To Calculate Compound Interest Using Function
Latest Ps2 Emulator Bios on this page. C - Mathematical Functions C. This C# Program Calculates Compound Interest. Here is source code of the C# Program to Calculate Compound Interest. Write a program which input principal, rate and time from user and calculate compound interest. C++:: Calculate Simple Interest Using Functions Jan 17, 2013. I was trying to make a program of calculating simple intrest using functions. I don't know whats wrong.
Best Hard Drive Diagnostic Tools. As noted by Mike, you need to assign ('give a value') the variables before using them. You can move the assignment of payment after getting the input data, like this: double amount; double rate; int numPayments; double payment; cout >amount; cout >rate; cout >numPayments; payment = (rate * pow((1 + rate), numPayments) / (pow((1+rate),numPayments)-1)) * amount. I'm not sure what the question really is. But I don't think this will work.
Double amount; double rate; int numPayments; double payment = (rate * pow((1 + rate), numPayments) / (pow((1+rate),numPayments)-1)) * amount; Because you didn't initialize them with a value, they will have random values. That's why shouldn't use rate in payment here. I would suggest to initialize them with 0.