write a program for function overloading?

Answer Posted / nekkanti rajesh

#include<iiostream.h>
class overload
{
public:
int max(int,int);
floatmax(float,float);
};
int overload::max(int num1,int num2)
{
if(num1>nmu2)
{
return num1;
}
else
{
return num2;
}
}
float overload::max(float num1,float num2)
{
if(num1>num2)
{
return num1;
}
else
{
return num2;
}
}
int main(90
{
overload o1;
cout<<"o1.max(5.4f,8.6f)<<endl;
cout<<"o1.max(19,34)<<endl;
}

Is This Answer Correct ?    143 Yes 57 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the three main types of variables?

834


What are main features of oop?

877


What does I oop mean?

839


is there any choice in opting subjects like 4 out of 7

1934


What is encapsulation in simple terms?

774


What is polymorphism what are the different types of polymorphism?

752


What is the difference between inheritance and polymorphism?

804


What are the 4 pillars of oop?

889


what is difference between class template and template class?

2402


What is class and example?

819


What are the benefits of interface?

803


What is polymorphism and why is it important?

777


how to get the oracle certification? send me the answer

1907


What is encapsulation in oops?

763


explain sub-type and sub class? atleast u have differ it into 4 points?

2043