C++ float type Calculate prime interest rate

Description

C++ float type Calculate prime interest rate

#include <iostream>
using namespace std;
int main()//from  www. j a v  a 2s  .com
{
   float prime, amount, interest;
   prime = 0.04;      // prime interest rate
   cout << "Enter the amount: ";
   cin  >> amount;
   interest = prime * amount;
   cout << "The interest earned is" << interest << " dollars" << endl;
   return 0;
}



PreviousNext

Related