C++ examples for Data Type:float
Calculate prime interest rate on float type variable
#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; }