I have a code like this...
#include<iostream>
using namespace std;
int main(){
float num;
cin >> num;
cout << num;
return 0;
}
Input: 256.1024
Output: 256.102
Why does C++ automatically rounds my float to three decimals?
I have a code like this...
#include<iostream>
using namespace std;
int main(){
float num;
cin >> num;
cout << num;
return 0;
}
Input: 256.1024
Output: 256.102
Why does C++ automatically rounds my float to three decimals?