Rounding Floating Point Number To two Decimal Places in C and C++
How to round off a floating point value to two places. For example, 5.567 should become 5.57 and 5.534 should become 5.53
First Method:- Using Float precision
Second Method: Using integer typecast If we are in Function then how return two decimal point value
Third Method: using sprintf() and sscanf()
This article is contributed by Devanshu Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.