E.4 Write a program that defines a macro with one argument to compute the volume of a sphere. The program should compute the volume for spheres of radii from 1 to 10 and print the results in tabular format. The formula for the volume of a sphere is
( 4.0 / 3 ) * π * r3
where π is
E.5 Write a program that produces the following output:
The sum of x and y is 13
The program should define macro
SUMwith two arguments,
y, and use
SUMto produce the output.
E.6 Write a program that uses macro
MINIMUM2to determine the smaller of two numeric values. Input the values from the keyboard.
E.7 Write a program that uses macro
MINIMUM3to determine the smallest of three numeric values. Macro
MINIMUM3should use macro ...
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.