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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!