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 polymorphism and types?
What is multilevel inheritance in oop?
What are the 3 principles of oop?
Why is polymorphism important in oop?
write a programe to calculate the simple intrest and compund intrest using by function overlading
What is abstraction oop?
How to call a non virtual function in the derived class by using base class pointer
What is an interface in oop?
Why is polymorphism used?
What are the 4 main oop principles?
What are main features of oop?
What is debug class?what is trace class? What differences are between them? With examples.
What is overloading in oop?
What is encapsulation with example?
Write a program to reverse a string using recursive function?