C++ Math lrint()The function rounds off the given value using current rounding mode and returns the value of type long int. SyntaxSuppose a number is 'x'. Syntax would be: Parameterx: The value that can be float, double or long double. Return valueIt returns the rounded value of x and the return type of the value is long int. Example 1Let's see a simple example. Output: Enter the value which you want to round : 7.8 Name of the methods are : 1. Rounding downwards 2. Rounding upwards 3. Rounding towards zero 4. Rounding to the nearest Enter the number of rounding method : 1 Rounding downwards,value is :7 Next TopicC++ Math Functions |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India