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 using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
What is encapsulation process?
Can abstract class have normal methods?
How do you use inheritance in unity?
What is meant by multiple inheritance?
How do you define social class?
Advantage and disadvantage of routing in telecom sector
How long to learn object oriented programming?
Describe these concepts: Polymorphism, Inheritance and Abstraction.
What is object in oop?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is debug class?what is trace class? What differences are between them? With examples.
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
Is this job good for future? can do this job post grduate student?
What is advantage of inheritance?