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


Please Help Members By Posting Answers For Below Questions

How Do you Code Composition and Aggregation in C++ ?

24724


What is the purpose of enum?

768


What are objects in oop?

828


2. Give the different notations for the class.\

1811


What is encapsulation in ict?

815


What is inheritance in simple words?

821


What is the significance of classes in oop?

806


What do you mean by variable?

764


What does and I oop mean?

840


What is abstraction with example?

829


is there any choice in opting subjects like 4 out of 7

1935


What do you mean by abstraction?

820


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1991


Can private class be inherited?

907


how to get the oracle certification? send me the answer

1907