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
What are the three main types of variables?
What are main features of oop?
What does I oop mean?
is there any choice in opting subjects like 4 out of 7
What is encapsulation in simple terms?
What is polymorphism what are the different types of polymorphism?
What is the difference between inheritance and polymorphism?
What are the 4 pillars of oop?
what is difference between class template and template class?
What is class and example?
What are the benefits of interface?
What is polymorphism and why is it important?
how to get the oracle certification? send me the answer
What is encapsulation in oops?
explain sub-type and sub class? atleast u have differ it into 4 points?