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 does and I oop mean?
hi all..i want to know oops concepts clearly can any1 explain??
Why do pointers exist?
What is encapsulation with example?
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is new keyword in oops?
what is the sylabus for priliminaries?
What are oops methods?
Can private class be inherited?
What are the benefits of polymorphism?
what is different between oops and c++
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
Which method cannot be overridden?
write a program that takes input in digits and display the result in words from 1 to 1000
Why is polymorphism important in oop?