Skip to content

Instantly share code, notes, and snippets.

@b-adams
Created September 21, 2011 16:30
Show Gist options
  • Save b-adams/1232555 to your computer and use it in GitHub Desktop.
Save b-adams/1232555 to your computer and use it in GitHub Desktop.
#include <stdio.h>
const int EGGS_IN_CARTON = 12;
const int HUNGRY_PEOPLE = 3;
const int DAYS_OF_X = 12;
const int SINGERS = 3;
void reportOnEggs();
void reportOnPackets();
int main(void)
{
reportOnEggs();
reportOnPackets();
reportOnEggs();
}
void reportOnEggs()
{
printf("There are %d eggs per person\n", EGGS_IN_CARTON/HUNGRY_PEOPLE);
printf("There are %d eggs per day\n", EGGS_IN_CARTON/DAYS_OF_X);
}
void reportOnPackets()
{
printf("We need %d song packets\n", DAYS_OF_X/SINGERS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment