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;
}