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


Please Help Members By Posting Answers For Below Questions

What is polymorphism explain its types?

944


What is oops in simple words?

836


Get me a number puzzle game-program

1956


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1924


What is pointer in oop?

752


What is difference between multiple inheritance and multilevel inheritance?

914


How do you define social class?

839


Why it is called runtime polymorphism?

816


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6405


What is object and example?

903


What is interface in oop?

892


Why do pointers exist?

903


What is encapsulation process?

804


What is object-oriented programming? Webopedia definition

977


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

3001