/* * CISC 105 * 06/13/05 * In-class example of putting eggs into cartons. * Demonstrates use of math library, formatting, and constants. * eggs.c */ #include #include #define CARTON_SIZE 12.0 int main() { int eggs = 100; double cartons; cartons = ceil(eggs/CARTON_SIZE); printf("We need %.0lf cartons.\n", cartons); // printf("We have %d eggs leftover. \n", eggs % CARTON_SIZE ); return 0; }