0
How to round to hundredths?
Input: a=3,141592 b=5,566 Output: a=3,14 b=5,57
3 Antworten
+ 2
Multiply by 100, rounddown, and then divide by 100.
Include standard math library to use floor function
https://code.sololearn.com/cAdE12itxlps/?ref=app
+ 2
The earliest way is to set precision
std::precision(number of positions +1);
https://code.sololearn.com/coguS2kSsZaw/?ref=app