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 abstraction and encapsulation?
How do you define social class?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What is the difference between abstraction and polymorphism?
Why it is called runtime polymorphism?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
What is new keyword in oops?
What is object in oop?
What does it mean when someone says I oop?
Why do we use encapsulation in oops?
write knight tour problem which is present in datastructure
What is inheritance and how many types of inheritance?
What is the advantage of oop over procedural language?
c++ program to swap the objects of two different classes
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.