write a program for function overloading?
Answer Posted / nekkanti rajesh
#include<iiostream.h>
class overload
{
public:
int max(int,int);
floatmax(float,float);
};
int overload::max(int num1,int num2)
{
if(num1>nmu2)
{
return num1;
}
else
{
return num2;
}
}
float overload::max(float num1,float num2)
{
if(num1>num2)
{
return num1;
}
else
{
return num2;
}
}
int main(90
{
overload o1;
cout<<"o1.max(5.4f,8.6f)<<endl;
cout<<"o1.max(19,34)<<endl;
}
| Is This Answer Correct ? | 143 Yes | 57 No |
Post New Answer View All Answers
#include
What are objects in oop?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
Can a destructor be called directly?
What is a function in oop?
What do you mean by Encapsulation?
What is abstraction example?
Why do pointers exist?
what type of questions
What is data binding in oops?
What is overloading and its types?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What is overriding in oops? What is abstraction in oop? What is the point of polymorphism?