Function overloading is compile time polymorphism.

Function overloading is the practice of declaring the same function with different signatures.

The same function name will be used with different number of parameters and parameters of different  type.

Overloading of functions with different return types is not allowed.

Compiler identifies which function should be called out of many using the type and number of arguments.

A function is overloaded when same name is given to different functions.

However, the two functions with the same name must differ in at least one of the following,

a) The number of parameters

b) The data type of parameters

c) The order of appearance

Example:

#include<iostream.h>
#include<conio.h>
#include<math.h>
#define PI 3.14
class A
{
    private:
        int a,b;
        float c;
    public:
        void area(int x)
        {
            a=x;
            cout<<" the area of circle="<<PI*a*a<<endl;
        }
        void area(int x,int y)
        {
            a=x;
            b=y;
            cout<<" the area of Rectangle="<<PI*a*a<<endl;
        }
        void area(float x ,int y,int z)
        {
            c=x;
            a=y;
            b=z;
            cout<<" the area of Triangle="<<PI*a*a<<endl;
        }
};
void main()
{
    A a1;
    int l,m,n;
    clrscr();
    cout<<"Enter l=";
    cin>>l;
    cout<<"Enter m=";
    cin>>m;
    cout<<"Enter n=";
    cin>>n;
    a1.area(l);
    a1.area(l,m);
    a1.area(0.5,l,m);
    getch();
}