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
Why is abstraction used?
What is encapsulation and abstraction? How are they implemented in C++?
Whats is abstraction in oops?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
How do you achieve polymorphism?
What is the example of polymorphism?
Can main method override?
Why do we use polymorphism in oops?
Why is destructor used?
What is multilevel inheritance in oop?
What is the difference between inheritance and polymorphism?
What are oops methods?
What is the difference between a mixin and inheritance?
Describe these concepts: Polymorphism, Inheritance and Abstraction.
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?