write a program for function overloading?

Answer Posted / krithika

#include<iostream.h>
#include<conio.h>
class a
{
int area(int a)
{
cout<<"enter the side";
cin>>a;
return(a*a(;
}
float area(float l,float b)
{
cout<<"enter the length and breadth":
cin>>l>>b;
return(l*b);
}
};
int main()
{
clrscr();
a e;
int a;
float l,b;
cout<<"the area of a square"<<e.area(a);
cout<<"the area of a rectangle"<<e.area(l,b);
getch();
return 0;
}

Is This Answer Correct ?    29 Yes 34 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does <> mean pseudocode?

624


what type of question are asked in thoughtworks pair programming round ?

1762


what is the 3 types of system development life cycle

2433


What is difference between class and object with example?

564


How do you explain polymorphism?

592






What is the purpose of enum?

581


what are the realtime excercises in C++?

2335


How to use CMutex, CSemaphore in VC++ MFC

4331


What is the fundamental idea of oop?

638


Which type does string inherit from?

616


Why is abstraction needed?

567


Can enum be null?

587


What is the significance of classes in oop?

590


What is the highest level of cohesion?

579


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1652