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


Please Help Members By Posting Answers For Below Questions

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?

1639


What is oops and its features?

594


How long to learn object oriented programming?

572


which feature are not hold visual basic of oop?

1727


What are objects in oop?

612






What is multilevel inheritance?

727


Explain the advantages of inheritance.

677


What is the point of oop?

661


What are the benefits of oop?

609


What is the significance of classes in oop?

592


Which language is pure oop?

553


What is overloading in oops?

601


What is the difference between procedural programming and oops?

561


What is oops concept with example?

582


What is the full form of oops?

619