{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw4 - 7(Ch 5 Problem 14 Write a function to return the...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
7. (Ch. 5, Problem 14) Write a function to return the volume of a sphere with the input argument for the radius of the sphere. Test your program with a radius of 5 meters. 8. (Ch. 5, Problem 17 a) Use the random number generation functions defined in header file stdlib.h for the following. a.) Write a program that generates two random integers ranging from 1-10. The random numbers generated by the program shall be different at each run. Then prompt the user to enter the product of the two numbers. If the user enters the right answer, print “Correct!” . If it is wrong, print “Incorrect. Please try again.” and allow the used to enter another answer until it is right. 9. (Ch. 6, Problem 4) Write a program that defines a macro with one
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
argument to compute the volume of a sphere. The program should compute the volume for spheres of radius 1 to 10 and print the results in tabular format. 10. (Ch.7, Problem 1) The definition of function f() is shown below.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}