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 difference between inheritance and polymorphism?
What is the main feature of oop?
What is constructor overloading in oop?
What is data binding in oops?
Can destructor be overloaded?
Which type does string inherit from?
Can we create object of abstract class?
Why it is called runtime polymorphism?
What is polymorphism and example?
What is class and example?
What is overloading in oop?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
Explain virtual inheritance?
What are main features of oop?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.