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
How is polymorphism achieved?
Why oops is important?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
write a program that takes input in digits and display the result in words from 1 to 1000
What are the 5 oop principles?
What is a function in oop?
What is destructor give example?
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
Advantage and disadvantage of routing in telecom sector
Write a c++ program to display pass and fail for three student using static member function
What is encapsulation c#?
What are the benefits of polymorphism?
What are the benefits of oop?
What are oops methods?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash