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 are oops methods?
write a programe to calculate the simple intrest and compund intrest using by function overlading
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
Can a varargs method be overloaded?
What is a class oop?
Which is not an object oriented programming language?
What are the advantages of polymorphism?
What is oops with example?
What is static modifier?
What are properties in oop?
Can destructor be overloaded?
What is solid in oops?
Why polymorphism is used in oops?
What are different oops concepts?
What does and I oop mean?