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
What is polymorphism explain its types?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
Why do we use oop?
Why it is called runtime polymorphism?
What is a null tree?
What is difference between pop and oop?
What is the renewal class?
State what is encapsulation and friend function?
Which language is pure oop?
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...
What is meant by oops concept?
write a C++ program for booking using constructor and destructor.
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
Can a destructor be called directly?
Why multiple inheritance is not possible?