write a program for function overloading?
Answer Posted / raja
#include<iiostream.h>
class overload
{
public:
int sum(int,int);
float sum(float,float);
};
int overload::sum(int num1,int num2)
{
return num1 + num2;
}
}
float overload::sum(float num1,float num2)
{
return num1+ num2
}
}
int main(90
{
overload o1;
cout<<"o1.sum(5.4f,8.6f)<<endl;
cout<<"o1.sum(19,34)<<endl;
}
| Is This Answer Correct ? | 28 Yes | 8 No |
Post New Answer View All Answers
What is the important feature of inheritance?
What is multilevel inheritance explain with example?
How can you overcome the diamond problem in inheritance?
What is overloading in oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is a null tree?
• What are the desirable attributes for memory managment?
What is encapsulation with example?
What is object and class in oops?
What are the benefits of oop?
Why do we use inheritance?
Can we create object of abstract class?
What is balance factor?
What are the components of marker interface?
class type to basic type conversion