Round up a value: ceil : Round « Math « C / ANSI-C






Round up a value: ceil

Round up a value: ceil

#include <stdio.h>
#include <math.h>

int main ()
{

  printf ("ceil of 3.3 is %.1lf\n", ceil (3.3) );

  printf ("ceil of 4.8 is %.1lf\n", ceil (4.8) );

  printf ("ceil of -3.3 is %.1lf\n", ceil (-3.3) );

  printf ("ceil of -4.8 is %.1lf\n", ceil (-4.8) );

  return 0;
}



           
       








Related examples in the same category

1.Round down value: how to use floor Round down value: how to use floor