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
write a program that takes input in digits and display the result in words from 1 to 1000
What is polymorphism explain its types?
What is meant by multiple inheritance?
What is solid in oops?
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is persistence in oop?
How do you achieve runtime polymorphism?
What is an advantage of polymorphism?
What is the difference between inheritance and polymorphism?
Can destructor be overloaded?
c++ program to swap the objects of two different classes
What is destructor example?
Which type does string inherit from?
What are the benefits of oop?
What is use of overloading?