Function Overloading:
int Area(int side);
int Area(int width, int length);
float Area(float radius);
void main()
{
int
s, w, l;
float
r;
cout<<"Enter the length
of a side of a square. \n";
cin >> s;
cout<<"The area of the
square is "<<Area(s) <<endl;
cout<<"Enter the length
and width of a retangle. \n";
cin >> l >> w;
cout<<"The area of the
retangle is "<<Area(w,l) <<endl;
cout<<"Enter the radius
of circle. \n";
cin >> r;
cout<<"The area of the
circle is "<<Area(r) <<endl;
}
int Area(int
side)
{
return side * side;
}
int Area(int
width, int length)
{
return width * length;
}
float Area(float
radius)
{
return 3.14 * radius * radius;
}