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
Explain the advantages of inheritance.
How do you achieve runtime polymorphism?
What is overloading and its types?
Why is oop useful?
Write a c++ program to display pass and fail for three student using static member function
• What are the desirable attributes for memory managment?
What is polymorphism used for?
class type to basic type conversion
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’.
can inline function declare in private part of class?
How does polymorphism work?
can we make game by using c
What is the purpose of enum?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What language is oop?