write a program for function overloading?
Answer Posted / narmadha
same function name with multiple definitions
#include <iostream.h>
void print(int i)
{
cout << " int " << i << endl;
}
void print(double f)
{
cout << " float " << f << endl;
}
void print(char* c)
{
cout << " char " << c << endl;
}
int main()
{
print(10);
print(10.10);
print("a");
return 0;
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is byval and byref? What are differences between them?
What is overloading and its types?
What is super in oop?
What are the three main types of variables?
What is the renewal class?
What is debug class?what is trace class? What differences are between them? With examples.
Whats oop mean?
Is html an oop?
Why is static class not inherited?
What is polymorphism explain?
Which method cannot be overridden?
What is destructor in oop?
Why is object oriented programming so hard?
What is a superclass in oop?
What are main features of oop?