write a program for function overloading?
Answer Posted / krithika
#include<iostream.h>
#include<conio.h>
class a
{
public:
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 ? | 44 Yes | 13 No |
Post New Answer View All Answers
write string class as your own class in java without using any built-in function
hi all..i want to know oops concepts clearly can any1 explain??
What is polymorphism give a real life example?
explain sub-type and sub class? atleast u have differ it into 4 points?
What is polymorphism and types?
What is inheritance in simple words?
What is oops in programming?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What does <> mean pseudocode?
What is the highest level of cohesion?
What is multilevel inheritance?
What is inheritance in oop?
What is balance factor?
Can we define a class within the interface?