**New course!**Every coder should learn

**Generative AI!**

0

# Round the float number

Hi everyone. I have some problems. This is my code double n=90.005; cout<< setprecision(2)<<fixed<<n; I want output is 90.01 but the code run and give me the answer is 90.00 But when I try 90.006 output is 90.01. I don't understand why. Can someone show me how to solve this problem????

2 Answers

+ 1

Correct output for your example is 90.00