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 is polymorphism programming?
What is data binding in oops?
What is polymorphism give a real life example?
How do you answer polymorphism?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
What is interface? When and where is it used?
What is meant by oops concept?
What is abstraction encapsulation?
What is inheritance in oop?
What is difference between data abstraction and encapsulation?
How do you define social class?
What do you mean by overloading?
Can we define a class within the interface?
What is encapsulation in ict?
to find out the minimum of two integer number of two different classes using friend function