Question: n C language , write a program to calculate the area of various shapes based on the choice from the user. the program should provide
n C language , write a program to calculate the area of various shapes based on the choice from the user.
the program should provide the user with a menu to select from
R-for retangle
T-for trapezoid
C-for circle
E-for end
the program should ask the for the proper input for every particular shape
A sample output may look like
This can fined the area of the following shapes :
R-rectangle
T-Trapezoid
C-Circle
E-End
Select your choice (R,T,C or E to end : R
Enter length : 50
Enter height : 20
The area of the rectangle is 1000.00 m^2
-------------------------------------------------------------------------
This can fined the area of the following shapes :
R-rectangle
T-Trapezoid
C-Circle
E-End
Select your choice (R,T,C or E to end : T
Enter base 1 : 20
Enter base 2 : 10
Enter height : 5
The area of the trapezoid is 75.00 m^2
-------------------------------------------------------------------------
This can fined the area of the following shapes :
R-rectangle
T-Trapezoid
C-Circle
E-End
Select your choice (R,T,C or E to end : C
Enter radius : 50
The area of the circle is 7857.14 m^2
-------------------------------------------------------------------------
This can fined the area of the following shapes :
R-rectangle
T-Trapezoid
C-Circle
E-End
Select your choice (R,T,C or E to end : e
---------------------------------------------------------------
This can fined the area of the following shapes :
R-rectangle
T-Trapezoid
C-Circle
E-End
Select your choice (R,T,C or E to end : x
Invalid choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
