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
class type to basic type conversion
What is encapsulation and abstraction? How are they implemented in C++?
What is polymorphism what are the different types of polymorphism?
What is difference between class and object with example?
What are two types of polymorphism?
#include
Why oops is important?
What does sksksk mean in text slang?
What is protected in oop?
What is difference between oop and pop?
What is abstraction in oop with example?
What is object and class in oops?
Are polymorphisms mutations?
which feature are not hold visual basic of oop?
Describe these concepts: Polymorphism, Inheritance and Abstraction.