write a program in c++ to overload the function add (s1,s2)
where s1 and s2 are integers and floating point values.
Answer Posted / rose
include<iostream.h>
class overload
{
void add (int a, int b){
int c;
int c= a+b;
}
void add( float a,float b){
double c;
double c = a+b;}
}
void main()
{overload o = new overload();
o.add(10,20);
o.add(1.2,34.56);
getch();
}
| Is This Answer Correct ? | 14 Yes | 10 No |
Post New Answer View All Answers
Write a program to reverse a string using recursive function?
What exactly is polymorphism?
What is oops and why we use oops?
Why is destructor used?
How to improve object oriented design skills?
Why is abstraction used?
How Do you Code Composition and Aggregation in C++ ?
Can we define a class within the interface?
What is oops with example?
Is react oop?
What does <> mean pseudocode?
What is overloading in oops?
Why polymorphism is used in oops?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
hi all..i want to know oops concepts clearly can any1 explain??