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
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What is the benefit of oop?
What is super in oop?
Are polymorphisms mutations?
What is the problem with multiple inheritance?
What is difference between pop and oop?
Why do we use oop?
Which language is pure oop?
What are the benefits of interface?
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).
What is encapsulation c#?
What are the 4 main oop principles?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is abstraction example?
What is pure oop?