Hi there.

For the output at the end, no matter what, if the output is a float, it will be an extremely high number (over 2 million.) If it is an integer, then the output is 0.

Code:// Trucking Program ~ ~ ~ ~ Sept. 19, 2013 // This program caluculates the costs and properties of shipping cans inside boxes #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> int main() { const float boxHeight = 60; //Declaring the dimensions of the box const float boxWidth = 100; const float boxLength = 75; float cansBoxWidth = 0; //number of cans that can fit in the width float cansBoxHeight = 0; //number of cans that can fit in in the height float cansBoxLength = 0; //number of cans that can fit in the length int numCans; //Number of cans needed to ship float canHeight; // Height of the cans float canRadius; // Radius of the cans float canDiameter; //diameter of the cans float distance; // Distance needed to transport the boxes int cansPerBox; // The # of cans that can fit inside ONE box int cansInAllBoxes; //The # of cans in EVERY box float loadCost; // The cost of loading/unloading boxes int numBoxes; //number of boxes required float totalCost; // Grand total float distanceCost; // cost of the distance travelled printf("Welcome to the can trucking program!\n"); printf("Please enter how many cans you wish to ship: "); scanf("%f", &numCans); printf("\nPlease enter the height of the cans you want to transport in cm: "); scanf("%f", &canHeight); printf("\nPlease enter the radius of your cans in cm: "); scanf("%f", &canRadius); printf("\nPlease enter how far you wish to transport the cans in km: "); scanf("%f", &distance); //This section gathers all the inputs from the user. ^^^^^ canDiameter = canRadius * 2; while (cansBoxHeight < 60) { cansBoxHeight += canHeight; if (cansBoxHeight > 60) { cansBoxHeight -= canHeight; break; } } while (cansBoxWidth < 100) { cansBoxWidth += canDiameter; if (cansBoxWidth > 100) { cansBoxWidth -= canDiameter; break; } } while (cansBoxLength < 75) { cansBoxLength += canDiameter; if (cansBoxLength > 75) { cansBoxLength -= canDiameter; break; } } cansPerBox = (cansBoxHeight / canHeight) * (cansBoxWidth/canDiameter) * (cansBoxLength / canDiameter); // ^^^We have the dimensions of cans per box, but now we need to know how many cans. cansInAllBoxes = cansPerBox; //We start out with one box, the section below adds more //boxes until they contain all the cans while (cansInAllBoxes < numCans) //This whole section determines how many boxes are { //needed to store all the cans. numBoxes += 1; cansInAllBoxes += cansPerBox; if (cansInAllBoxes >= numCans) { break; } } loadCost = 8 * numBoxes; //Figuring out the other expenses distanceCost = 0.37 * distance * numBoxes; totalCost = loadCost + distanceCost; printf("The number of cans per box: %d\n", &cansPerBox); printf("The number of boxes: %d\n", &numBoxes); printf("Cost of loading the boxes: %f\n", &loadCost); printf("Cost of transporting the boxes: %f\n", &distanceCost); printf("Grand total: %f\n", &totalCost); system("pause"); return 0; }

agrees