Function Overloading in C++

It simply means that a family functions with one function name but with different argument lists. The function would perform different operations depending on the argument list in the function call.

Program:

#include<iostream.h>
#include<conio.h>
int area(int);
int area(int, int);
float area(float);
int main()
{
 cout<<"The area of Square:"<<area(12)<<"\n";
 cout<<"The area of Rectangle:"<<area(12,15)<<"\n";
 cout<<"The area of Circle:"<<area(7)<<"\n";
return 0;
}
int area(int s)
{
 return(s*s);
}
int area(int l, int b)
{
 return(l*b);
}
float area(float r)
{
 return(3.14*r*r);
}

Output:

The area of Square: 144
The area of Rectangle: 180
The area of Circle: 153.86