An online bank wants you to create a program that shows prospective customers how their deposits will grow. Your program should prompt the user for initial balance and the annual interest rate in percent. Choose double datatypes for variables to store initial balance and annual interest rate that you received from the user. Interest is compounded monthly. Computer and print out the balances after the first three months.

Respuesta :

#include<iostream>

#include<math.h>

using namespace std;

int main()

{

  double initbalance, annualinterestrate,finalbalance;

  int nom;

  cout<<"Enter initial balance and annualinterestrate:";

  cin>>initbalance;

  cin>>annualinterestrate;

  cout<<"no. of months:";

  cin>>nom;

  finalbalance=initbalance*(pow((1+annualinterestrate/100),nom));

  cout<<"After N Months the final balance is::"<<finalbalance;

  return 0;

}