write a program for function overloading?

Answer Posted / raja

#include<iiostream.h>
class overload
{
public:
int sum(int,int);
float sum(float,float);
};
int overload::sum(int num1,int num2)
{
return num1 + num2;
}
}
float overload::sum(float num1,float num2)
{
return num1+ num2
}
}
int main(90
{
overload o1;
cout<<"o1.sum(5.4f,8.6f)<<endl;
cout<<"o1.sum(19,34)<<endl;
}

Is This Answer Correct ?    28 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is polymorphism and types?

600


What is multilevel inheritance in oop?

557


What are the 3 principles of oop?

619


Why is polymorphism important in oop?

630


write a programe to calculate the simple intrest and compund intrest using by function overlading

1668






What is abstraction oop?

623


How to call a non virtual function in the derived class by using base class pointer

5256


What is an interface in oop?

593


Why is polymorphism used?

583


What are the 4 main oop principles?

685


What are main features of oop?

632


What is debug class?what is trace class? What differences are between them? With examples.

1608


What is overloading in oop?

575


What is encapsulation with example?

578


Write a program to reverse a string using recursive function?

1792