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
What is the fundamental idea of oop?
What is constructor overloading in oop?
Why multiple inheritance is not possible?
What is a class in oop?
i got a backdoor offer in process global,Bangalore..Can i work with it?
When not to use object oriented programming?
What are two types of polymorphism?
What is the example of polymorphism?
What are the benefits of interface?
c++ program to swap the objects of two different classes
What are functions in oop?
What is difference between data abstraction and encapsulation?
What is methods in oop?
What makes a language oop?
What are the types of abstraction?