PROGRAM TO PERFORM FUNCTION OVERLOADING

Program to perform function overloading:Code:

#include<iostream.h>
#include<conio.h>
void multiply(int x)
{
cout <<"the value is"<<"\t"<<x*3<<"\n";
}
void multiply(int x,int y)
{
cout<<"the value is"<<"\t"<<x*y<<"\n";
}
void main()
{
clrscr();
multiply(3);
multiply(3,5);
getch();
}

Output:
the value is 9
the value is 15

Comments

Popular posts from this blog

PROGRAM TO PERFORM CALL BY REFERENCE

PROGRAM TO PERFORM RRETURN BY REFERENCE