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
Can bst contain duplicates?
What is oops concept with example?
What is advantage of inheritance?
Can we have inheritance without polymorphism?
Please send ford technologies placement paper 2 my mail id
What is the main feature of oop?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
#include
What are the data types in oop?
What is polymorphism oop?
What does enum stand for?
What is the main purpose of inheritance law?
What causes polymorphism?
What is the difference between a constructor and a destructor?
What is encapsulation example?