C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C++ Math ceil()It rounds the value to the nearest integer which is not less than the given value. For example : ceil(8.1)=9.0; ceil(-8.8)=-8.0; SyntaxSuppose a number is 'x'. Syntax would be: double ceil(double x); Parameterx : It is the value that rounds to the nearest integer. Return valueIt returns the smallest integer value not less than x. Example 1Let's see a simple example by considering the positive value of x. #include Output: Initial value of x is :9.2 final value of x is :10 Example 2Let's see a simple example by considering the negative value of x. #include Output: Initial value of x is :-2.2 final value of x is :-2
Next TopicC++ Math Functions
|