Login


Lost your password?

Don't have an account ? Register ×
  
CPP All : User Defined Data Types
Concept Learning Code Sheets

using setprecision without fixed or scientific format. #4341

typedef as replacement for using a friendlier name.

#include <iostream>
typedef double amount;
using namespace std;
int main()
{
amount principal=100.50;
amount term=2.5;
amount rate=5.5;
amount simple_interest=principal*term*rate/100.0;
cout<<"Simple Interest = "<<simple_interest<<endl;
return 0;
}



Code Sheets:1 
Back