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
Is react oop?
What is oops concept with example?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
Is oop better than procedural?
What is constructor overloading in oop?
What are oops methods?
What is oops and its features?
Why is abstraction needed?
What are classes oop?
What is encapsulation in ict?
write knight tour problem which is present in datastructure
What are the benefits of polymorphism?
What are the types of abstraction?
Is html an oop?