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
What does <> mean pseudocode?
what type of question are asked in thoughtworks pair programming round ?
what is the 3 types of system development life cycle
What is difference between class and object with example?
How do you explain polymorphism?
What is the purpose of enum?
what are the realtime excercises in C++?
How to use CMutex, CSemaphore in VC++ MFC
What is the fundamental idea of oop?
Which type does string inherit from?
Why is abstraction needed?
Can enum be null?
What is the significance of classes in oop?
What is the highest level of cohesion?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?