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 meant by multiple inheritance?

970


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

3000


what is difference between class template and template class?

2425


Who invented oop?

865


What does I oop mean?

857


Can we override main method?

867


to find out the minimum of two integer number of two different classes using friend function

1892


What is the difference between abstraction and polymorphism?

868


What is object in oop with example?

986


How is polymorphism achieved?

787


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

2079


What are objects in oop?

855


Why we use classes in oop?

806


What is the point of polymorphism?

799


What is the main feature of oop?

920