Horje
Function to calculate compound interest in C++ Code Example
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; 





Cpp

Related
C++ to specify size and value Code Example C++ to specify size and value Code Example
geekforgeeks stacks Code Example geekforgeeks stacks Code Example
c++ program to print odd numbers using loop Code Example c++ program to print odd numbers using loop Code Example
c++ program to convert celsius to fahrenheit Code Example c++ program to convert celsius to fahrenheit Code Example
maximum subarray leetcode c++ Code Example maximum subarray leetcode c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10