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

Write a program to sort the number with different sorts in one program ??

2366


program for insertion ,deletion,sorting in double link list

2680


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6676


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).

2147


Can abstract class have normal methods?

1041


Why do we use polymorphism in oops?

1033


What is the difference between abstraction and polymorphism?

1091


Can private class be inherited?

1166


• What are the desirable attributes for memory managment?

2225


What does and I oop mean in text?

1211


Why we use classes in oop?

1032


Where is pseudocode used?

1096


What is stream in oop?

1297


Write a program to reverse a string using recursive function?

2336


What is encapsulation with example?

1093