1. A quick programming question

Now, I don't want anyone to do my homework for me, but I was hoping someone could give me some insite on how to do a program that was assigned to me. What I have to do is ask the user to enter the amount of, lets say, widgets that are to be sent out to businesses. There are 4 containers that these widgets can be sent in : Huge container that holds 50 ; a Large container that holds 20; A medium container that holds 5; and a container that can hold one widget. The program has to be written in a way that the shipment is sent using the minimum amount of containers and with the minimum amount of waste. Any ideas would be great. I've been trying to use the Mod Operator (Ex. 50 % 4)..It doesn't seem to be affective. Thanks

2. Let's say x is the number of widgets...

x / 50 == the number of size 50 containers to use
x % 50 == the number of widgets left over

3. I tried that. It was placing most of the containers into the Huge containers, and some in the large...but none in the medium or small. And since, we have to use the minimum amount of containers, it important to use them all in some equal form.

Thanks for replying. This is my code thus far.

#include <stdio.h>
#define huge 50
#define large 20
#define medium 5
#define small 1
int main()

{

int doofs;
int x;
int y;
int z;
int w;
int v;
int f;
int m;
int p;

printf("How many dooflingies have to be shipped out? :");
scanf("%d",&doofs);

x = doofs/huge;
v = doofs % huge;
y = v/large;
f = doofs % large;
z = y/medium;
p = doofs % medium;

w = z/small;
m = doofs % small;

printf("\n\n");

printf("You can transport %d dooflingies in the Huge containers\n",x);
printf("You can transport %d dooflingies in the Large containers\n",y);
printf("You can transport %d dooflingies in the Medium containers\n",p);
printf("You can transport %d dooflingies in the Small containers\n",m);

return 0;}

4. I suppose it depends on the definition of waste (is it ideal to send the fewest boxes, or have the smallest amount of unused space?). If you don't want any unused space in your shipment of widgets, you could try somthing like this:

Code:
```while ( WidgetsToSend )
{
if ( WidgetsToSend >= 50 )
{
Box50++;
WidgetsToSend -= 50;
}

else if ( WidgetsToSend >= 20 )
{
Box20++;
WidgetsToSend -= 20;
}

else if ( WidgetsToSend >= 5 )
{
Box5++;
WidgetsToSend -= 5;
}

else if ( WidgetsToSend >= 1 )
{
Box1++;
WidgetsToSend -= 1;
}
}```