Why doubles round themselves? How can i prevent it? If i insert 45000.98 i expect 45000.98, but the number is rounded.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double a;
cin >> a; //if i insert 45000.98
cout << a; //output is 45001
cout << endl << setprecision(2) << a; //output is 4.5e+04
}