Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Homework HelpRSS Feeds

Program of that provides an example of function overloading

Posted By: Lola Hughes     Category: C++ Programming     Views: 7905

Write a program of that provides an example of function overloading.

Code for Program of that provides an example of function overloading in C++ Programming

# 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;
}
  
Share: 



Lola Hughes
Lola Hughes author of Program of that provides an example of function overloading is from London, United Kingdom.
 
View All Articles

 

Other Interesting Articles in C++ Programming:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!