

#include <math.h> double ceil(double y);
ceil rounds up a real number to the next larger integral real number.
ceil accepts a floating-point argument y and rounds it up to the
next larger integer, expressed as a floating-point number.
ceil is implemented by a built-in function unless it is undefined by an
#undef statement.
#include <math.h>
#include <stdio.h>
int moda, modb, df;
double score, rank;
main()
{
puts("Enter two integers: ");
scanf("%d %d", &moda, &modb);
puts("Enter an integer divisor: ");
scanf("%d",&df);
/* Add the two numbers, divide by the given divisor, and */
/* then round up to the closest integer greater than */
/* the result. */
score = (moda + modb);
score /= df;
rank = ceil(score);
/* Print this rounded result (its "ceil"ed value). */
printf("The ceiling of (%d + %d)/ %d = %fn",moda,modb,df,rank);
}
floor
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.