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 the fundamental idea of oop?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What are oops functions?
What is polymorphism and its types?
What is difference between oop and pop?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What does I oop mean?
State what is encapsulation and friend function?
What is inheritance in oop?
What is variable example?
What do you mean by overloading?
Whats oop mean?
What is purpose of inheritance?
What do you mean by Encapsulation?
What is pointer in oop?