function to calculate compound interest in c 2b 2b

Solutions on MaxInterview for function to calculate compound interest in c 2b 2b by the best coders in the world

showing results for - "function to calculate compound interest in c 2b 2b"
Chiara
20 Aug 2020
1float CoumpoundInterest (float AmountP,float rateP, int termP)//Define the function and FORMAL parameters
2{
3    rateP=rateP/100;
4    float calculation = AmountP * pow(1+rateP,termP);
5    return calculation;
6
7}
8//CALLING THE FUNCTION IN THE MAIN PROGRAM: 
9
10//Declaration of ACTUAL paramters 
11float amount,rate, total;
12int term;
13
14//Assignment statement to call the function.
15
16cout.setf(ios::fixed);
17cout.precision(2);
18total=CompoundInterets(amount,rate,term)
19
20//OUTPUT
21cout<<total; 
22
23
similar questions