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 / selvanayaki

#include<conio.h>
#include<iostream.h>

class arith {
public:
void calc(int num1)

{
cout<<"\n\nSquare of a given number: " <<num1*num1 <<endl;
}

void calc(int num1, int num2 )

{
cout<<"\n\nSquare of a given number: " <<num1*num2 <<endl;
}
};


void main() //begin of main function
{
clrscr();
arith a;
a.calc(5);
a.calc(6,7);
getch();
}

Is This Answer Correct ?    25 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 oop principles?

1070


What is class in oop with example?

1039


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

2075


How Do you Code Composition and Aggregation in C++ ?

25258


What is abstraction encapsulation?

1059


What is advantage of inheritance?

1127


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1923


What does and I oop mean?

1101


What is oops?what is its use in software engineering?

972


Explain virtual inheritance?

1125


Why multiple inheritance is not possible?

1017


What is class and example?

1090


What is overloading in oops?

1091


Why do we use encapsulation in oops?

970


How do you achieve runtime polymorphism?

992