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


Please Help Members By Posting Answers For Below Questions

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

2749


What is encapsulation process?

573


Can abstract class have normal methods?

600


How do you use inheritance in unity?

580


What is meant by multiple inheritance?

729






How do you define social class?

594


Advantage and disadvantage of routing in telecom sector

780


How long to learn object oriented programming?

555


Describe these concepts: Polymorphism, Inheritance and Abstraction.

604


What is object in oop?

671


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3550


What is debug class?what is trace class? What differences are between them? With examples.

1598


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.

1447


Is this job good for future? can do this job post grduate student?

1685


What is advantage of inheritance?

683