Loan + Intrest

i want to get this


Loan Amount: $ 10000.00
Monthly Interest Rate: 1%
Number of Payments: 36
Monthly Payment: $ 332.14
Amount Paid Back: $ 11957.15
Interest Paid: $ 1957.15

and this is all i can come up with

#include<iostream>
#include<iomanip>

using namespace std;

int main()

{
int payment, loan, rate, numPay;

cout << "Please enter the loan needed" <<endl;
cin >> loan;
rate = .01;
cout << "Please enter the number of payments desired" <<endl;
cin >> numPay;


payment = loan * (rate * pow(1 + rate, numPay)) / (pow(1+rate, numPay)-1);
Topic archived. No new replies allowed.