I have two floating point numbers. If I add that 2 numbers means. It will displaying the answer as 4.50000 (I used just %f). If I used (2.%f) means the answer is just 4.
I want the answer as 4.5. What do I have to modify in this?
I have two floating point numbers. If I add that 2 numbers means. It
Share
Try the format string
%2.1f:The
.1says “one character after the radix”.