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
Whats is abstraction in oops?
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.
What is static in oop?
program for insertion ,deletion,sorting in double link list
is there any choice in opting subjects like 4 out of 7
What is the renewal class?
What is interface? When and where is it used?
What are functions in oop?
What makes a language oop?
What are the 4 pillars of oop?
How to use CMutex, CSemaphore in VC++ MFC
Give two or more real cenario of virtual function and vertual object
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What are the 4 main oop principles?
Can an interface inherit a class?