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 interface? When and where is it used?
What are constructors in oop?
What are the types of abstraction?
what are the different types of qualifier in java?
What is the types of inheritance?
What is a class and object?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is multilevel inheritance?
What does and I oop mean in text?
What is the real time example of inheritance?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What is class and object in oops?
What causes polymorphism?
What does and I oop and sksksk mean?