Write an algorithm to find simple interest and compound interest
Answers
The algorithm to calculate the simple interest and compound interest is as follows:
Step 1:Start
Step 2:Read Principal Amount, Rate and Time
Step 3:Calculate Interest using formula SI= ((amount*rate*time)/100)
Step 4:Print Simple Interest
Step 5:Stop
// CPP program to find compound interest for
// given values.
#include <bits/stdc++.h>
using namespace std;
int main()
{
double principle = 10000, rate = 10.25, time = 5;
/* Calculate compound interest */
double CI = principle * (pow((1 + rate / 100), time));
cout << ""Compound interest is "" << CI;
return 0;
}
Answer:
The algorithm to calculate the simple interest and compound interest is as follows:
Step 1:Start.
Step 2:Read Principal Amount, Rate and Time.
Step 3:Calculate Interest using formula SI= ((amount*rate*time)/100)
Step 4:Print Simple Interest.
Step 5:Stop. // CPP program to find compound interest for. // given values.
hope it's helpful!
please like this answer and mark me brianlisted!