Cpp Code for Loan Payment

This cpp programming code is used to find the loan payment . You can select the whole cpp code by clicking the select option and can use it. When you click text, the code will be changed to text format. This cpp program code will be opened in a new pop up window once you click pop-up from the right corner. You can just copy, paste this cpp code and use it to find the loan payment .

#include<iostream>
using namespace std;
#include<math.h>
int main(void)
{
  double inst=0.4, loan_amt=0.56, pay=0.34;   
  double mon = (inst/1200);
  double quarterly = (inst/400);
  double Half = (inst/200);
  double annual = (inst/100);

//Mothly
  double ad = 1 + mon;      
  double amt,amt_mon,amt2; 
    amt_mon = -1*((log( 1 - ((mon * loan_amt) / pay))));
    amt2 =(log(ad));
    amt = (amt_mon / amt2);
    cout<<"\nNumber of Payments based on monthly : "<<amt;
    
    //Quarterly
    
    ad = 1 + quarterly;
      double amt_quart;
    amt_quart = (( -log( 1 - ((quarterly * loan_amt) / pay))));
    amt = (amt_quart / amt2);
    cout<<"\nNumber of Payments based on quarterly : "<<amt;
    
    //HalfYearly
    ad = 1 + Half;
      double amt_half;
    amt_half = (( -log( 1 - ((Half * loan_amt) / pay))));
    amt = (amt_half / amt2);
    cout<<"\nNumber of Payments based on HalfYearly : "<<amt;
    
    //Annually
    ad = 1 + annual;
      double amt_ann;
    amt_ann = (( -log( 1 - ((annual * loan_amt) / pay))));
    amt = (amt_ann / amt2);
    cout<<"\nNumber of Payments based on Annually : "<<amt;
    return 0;

}
Other Programming Codes
Online Calculator : Loan Payment Calculator
Click on the select code link to copy and paste this free cpp program code for loan payment calculator.

english Calculators and Converters


Sitemap