Example of Ceil function in C

Here is a simple ceil example usage in C programming.

/* Example of Ceil function*/
#include <stdio.h>
#include <math.h>
int main ()
  printf ("ceil of 2.3 is %.1lf\n", ceil (2.3) );
  printf ("ceil of 3.8 is %.1lf\n", ceil (3.8) );
  printf ("ceil of -2.3 is %.1lf\n", ceil (-2.3) );
  printf ("ceil of -3.8 is %.1lf\n", ceil (-3.8) );
  return 0;

Output will be:
ceil of 2.3 is 3.0
ceil of 3.8 is 4.0
ceil of -2.3 is -2.0
ceil of -3.8 is -3.0

Tags: ,

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …

Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us