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 multiple inheritance and multilevel inheritance?
what are the different types of qualifier in java?
What is difference between abstraction and encapsulation?
what is different between oops and c++
Write a program to reverse a string using recursive function?
What is encapsulation in simple terms?
What is super in oop?
What is multilevel inheritance explain with example?
what is difference between class template and template class?
What is the difference between a constructor and a destructor?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Where You Can Use Interface in your Project
Describe these concepts: Polymorphism, Inheritance and Abstraction.
What is inheritance in simple words?
hi all..i want to know oops concepts clearly can any1 explain??