Calculate prime interest rate on float type variable - C++ Data Type

C++ examples for Data Type:float

Description

Calculate prime interest rate on float type variable

Demo Code

#include <iostream>
using namespace std;
int main()/*ww w . j av a  2  s. c  o m*/
{
   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;
}

Result


Related Tutorials