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
#include
Why is abstraction needed?
What is multilevel inheritance?
How long to learn object oriented programming?
What is polymorphism and why is it important?
What do you mean by abstraction?
What is the point of oop?
How do you use inheritance in unity?
How to use CMutex, CSemaphore in VC++ MFC
What makes a language oop?
How is polymorphism achieved?
Can a varargs method be overloaded?
Can abstract class have normal methods?
Why do we use oop?
How do you answer polymorphism?