write a program for function overloading?
Answer Posted / riks
#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 ? | 39 Yes | 23 No |
Post New Answer View All Answers
How to use CMutex, CSemaphore in VC++ MFC
What is the advantage of oop over procedural language?
Why it is called runtime polymorphism?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
Why polymorphism is used in oops?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
How do you answer polymorphism?
What are main features of oop?
What are the 3 principles of oop?
What is oops in simple words?
Which language is pure oop?
What does no cap mean?
How Do you Code Composition and Aggregation in C++ ?
What is polymorphism and types?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.