write a program for function overloading?
Answer Posted / selvanayaki
#include<conio.h>
#include<iostream.h>
class arith {
public:
void calc(int num1)
{
cout<<"\n\nSquare of a given number: " <<num1*num1 <<endl;
}
void calc(int num1, int num2 )
{
cout<<"\n\nSquare of a given number: " <<num1*num2 <<endl;
}
};
void main() //begin of main function
{
clrscr();
arith a;
a.calc(5);
a.calc(6,7);
getch();
}
Is This Answer Correct ? | 25 Yes | 7 No |
Post New Answer View All Answers
What is polymorphism explain its types?
What is multilevel inheritance in oop?
Is enum a class?
What is polymorphism used for?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
What are the types of abstraction?
What is class in oop with example?
Can main method override?
Can you explain polymorphism?
Why do while loop is used?
What do you mean by variable?
What is debug class?what is trace class? What differences are between them? With examples.
How many human genes are polymorphic?
what type of question are asked in thoughtworks pair programming round ?
What is difference between oop and pop?