English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The ceil(x) function returns the smallest integer greater than or equal to x.
double ceil(double arg);
The ceil() function takes a single parameter and returns an int type value.
For example:If you pass2.3Pass to ceil(), which will return3.
The function is in<math.h>Defined in the header file.
long double ceill(long double arg); float ceilf(float arg);
To find ceil() for long double or float, you can use the above prototype.
#include <stdio.h> #include <math.h> int main() { double num = 8.33; int result; result = ceil(num); printf("%.2f Minimum Integer Value = %d", num, result); return 0; }
Output Result
8.33 Minimum Integer Value = 9