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();
}
the value is 9
the value is 15
Comments
Post a Comment