Program of FUNCTION OVERLOADING

/*Program of FUNCTION OVERLOADING*/

#include
#include
int add(int,int,int); // function declaration
float add(float,float); // function declaration
int add(int q, int w, int e) // function definition
{
return (q+w+e);
}
float add(float a, float s) // function defintion
{
return (a*s);
}
int main()
{
int q,w,e;
float a,s;
cout<<"Enter 3 integers "; cin>>q>>w>>e;
int p=add(q,w,e); // function calling through parameters
cout<<"Addition of 3 integers : "<>a>>s;
float z=add(a,s); // function calling through parameters
cout<<"\nMultiplication of 2 float values : "<OUTPUT :

Enter 3 integers 8 9 7
Addition of 3 integers : 24
Enter 2 float values 3.5 5.6
Multiplication of 2 float values : 19.6







Leave a Reply

Your email address will not be published. Required fields are marked *