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
This
preview
has intentionally blurred sections.
Sign up to view the full version.
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.

This is the end of the preview.
Sign up
to
access the rest of the document.
- Fall '07
- Cheng
- Randomness, initial projection angles, return x*i*j
-
Click to edit the document details