write a program for function overloading?
Answer Posted / riks
#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 ? | 39 Yes | 23 No |
Post New Answer View All Answers
how to get the oracle certification? send me the answer
What is advantage of inheritance?
What is object in oops?
What are the types of abstraction?
What is constructor overloading in oop?
What does no cap mean?
any one please tell me the purpose of operator overloading
What is protected in oop?
Why multiple inheritance is not possible?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
What are benefits of oop?
what type of question are asked in thoughtworks pair programming round ?
• What are the desirable attributes for memory managment?
Why do we use inheritance?