|
Answers to Selected Exercises
2. [was #2] (a) The program contains one directive (#include) and four statements (three calls of printf and one return). (b)
Parkinson's Law:
Work expands so as to fill the time available for its completion. 3. [was #4]
#include <stdio.h>
int main(void) {
int height = 8, length = 12, width = 10, volume;
volume = height * length * width;
printf("Dimensions: %dx%dx%d\n", length, width, height); printf("Volume (cubic inches): %d\n", volume);
printf("Dimensional weight (pounds): %d\n", (volume + 165) / 166);
return 0; }
|
|