0

Float_print

https://code.sololearn.com/cA9DNi79jHZM/?ref=app Hi friends... Getting output for this code as 172.529999 But x=172.53 How could I get exact value

12th Jun 2019, 5:18 PM
malepu rakesh
malepu rakesh - avatar
2 Respostas
+ 4
Set the decimal point to 2 digits seems to output what you expected printf ("%.2f",x); Or use double type rather than float, better precision.
12th Jun 2019, 5:59 PM
Ipang