![]() |
In this program, we have written to demonstrate polymorphism base class Shape and derived classes Rectangle and Circle.
Input for Rectangle - length = 15, Breadth = 5
Output - Area of Rectangle - 75
The perimeter of the Rectangle - 40
Input for Circle - radius = 15
Output - Area of Circle - 706.5
The perimeter of Circle - 94.2
Here is the program:
0 Comments