Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can a destructor be called directly?

1019


Give two or more real cenario of virtual function and vertual object

2282


What is the purpose of polymorphism?

1083


Which language is not a true object oriented programming language?

1061


What is coupling in oops?

1065


What is debug class?what is trace class? What differences are between them? With examples.

2132


How do you achieve polymorphism?

1036


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2407


What is advantage of inheritance?

1127


officer say me - i am offered to a smoking , then what can you say

2044


What is meant by oops concept?

989


What is abstraction example?

1041


What is overloading in oops?

1091


can we make game by using c

4035


What is and I oop mean?

1107