In this tutorial, we will learn about ceil function in C programming language
In the C Programming Language, the ceil() returns the nearest integer value which is greater than or equal to the value of floating point passed value.
Syntax
The syntax of the ceil() function in the C programming Language
double ceil(double x);
x is the parameter or argument of this , x is a floating point value.
when the value for x is passed, this is returns the ceil value of x
In the C Language, the required header file for ceil() function is
#
include <math.h>
program
The following example explains the usage of ceil() function
//Example for ceil math function in C language #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { //Define temporary variables double a=12.1,b=12.9,c=-12.1,d=-12.9; //Calculate and display ceil value for given value printf("ceil value of a: %f\n",ceil(a)); printf("ceil value of b: %f\n",ceil(b)); printf("ceil value of c: %f\n",ceil(c)); printf("ceil value of d: %f\n",ceil(d)); return 0; }
When the above program is compiled and run, it will produce the following result
ceil value of a: 13.000000
ceil value of a: 13.000000
ceil value of a: -12.000000
ceil value of a: -12.000000
Similar Functions
Other C programming language functions that are similar to the cosine function
suggested for you
User defined function in C language
How to find reverse number using method In this article, we will discuss the concept…
C# inverted full pyramid star pattern In this article, we will discuss the concept of…
C# Full Pyramid star pattern program In this article, we will discuss the concept of…
Program to count vowels, consonants, words, characters and space in Java In this article, we…
How to print multiplication table using Array in C++ language In this post, we will…
C Program to multiplication table using Array In this tutorial , we will discuss about…