Answers for "Function to calculate compound interest in C++"

C++
0

Function to calculate compound interest in C++

float CoumpoundInterest (float AmountP,float rateP, int termP)//Define the function and FORMAL parameters
{
    rateP=rateP/100;
    float calculation = AmountP * pow(1+rateP,termP);
    return calculation;

}
//CALLING THE FUNCTION IN THE MAIN PROGRAM: 

//Declaration of ACTUAL paramters 
float amount,rate, total;
int term;

//Assignment statement to call the function.

cout.setf(ios::fixed);
cout.precision(2);
total=CompoundInterets(amount,rate,term)

//OUTPUT
cout<<total;
Posted by: Guest on September-28-2021

Code answers related to "Function to calculate compound interest in C++"

Browse Popular Code Answers by Language