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
What is oops with example?
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.
Why do we use oop?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
write a program that takes input in digits and display the result in words from 1 to 1000
What is overloading and its types?
Why it is called runtime polymorphism?
Which is not an object oriented programming language?
What is overriding in oops?
What is an example of genetic polymorphism?
What is encapsulation c#?
Why is static class not inherited?
What is constructor overloading in oop?
What is byval and byref? What are differences between them?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer