Question: Write a program that uses two functions to calculate area of a circle and of a rectangle. Instruction: Declare P1 as a global constant. Use
Write a program that uses two functions to calculate area of a circle and of a rectangle. Instruction: Declare P1 as a global constant. Use function prototype on both function. Bonus points (10): interactive input using loops, and the area of circle rounded to two decimal places. Function 1, calculate area of a circle and returns the values. Example: double circle(double r) {write code to return area of a circle (area is 3.14* radius squared)} Function 2, calculate area of a rectangle and displays the values. Example: void rectangle(int length, int width) {write code to displays area of rectangle (area is length * width)}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
