WIL(What I Learned)/KNK C Programming (2) 썸네일형 리스트형 Chapter.2 Programming Projects 1. Write a program that uses printf to display the following picture on the screen: * * * * * * * * my sol) #include int main() { printf(" *\n"); printf(" *\n"); printf(" *\n"); printf("* *\n"); printf(" * *\n"); printf(" * \n"); return 0; } 2. Write a program that computes the volume of a sphere with a 10-meter radius, using the formula v = 4/3πr^3. Write the fraction 4/3 as 4.0f/3.0f (Try writ.. Chapter 2. 연습문제 3. Condense the dweight.c program by (1) replacing the assignmetns to height, length, and width with initializers and (2) removing the weight variable, instead calculating (volume + 165) / 166 within the last printf. 정답: #include 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("V.. 이전 1 다음