Need help reading float from console and maintaining decimal values. I am unable to find a good answer online. cout will print correct value but if I add a break point x reads the below given values.
Below code for input 1.45 convert x to 1.4500005 and 10.45 to 10.4499998.
#include <iostream>
using namespace std;
int main() {
float x;
cin >> x;
cout << x;
return 0;
}