C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
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: long int lrint(data_type x); 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. #include 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
|