C++ Programming Blog

 
 
 
# include <iostream.h>
# include <conio.h>

main()
{
    void f();
    void f(int a,int b=20);
    void f(int a,float c=20.9);
    int i;
    float b=67.8;
    clrscr();
    f();
    f(10,40);
    f(90,b);
}

void f()
{
    cout<<\"THIS IS A EXAMPLE OF FUNCTION OVERLOADING\"<<endl;

}

void f(int a=10,int b=20)
{
    cout<<\"THE ADDITION IS:->\"<<a+b<<endl;
}
void f(int a=90,float c=20.9)
{
    cout<<\"THE ADDITION IS:->\"<<a+c<<endl;
}

 
 
Didn't find what you were looking for? Find more on Program of that provides an example of function overloading