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
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 is oops and its features?
How long to learn object oriented programming?
which feature are not hold visual basic of oop?
What are objects in oop?
What is multilevel inheritance?
Explain the advantages of inheritance.
What is the point of oop?
What are the benefits of oop?
What is the significance of classes in oop?
Which language is pure oop?
What is overloading in oops?
What is the difference between procedural programming and oops?
What is oops concept with example?
What is the full form of oops?