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
Write a program to sort the number with different sorts in one program ??
program for insertion ,deletion,sorting in double link list
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
Can abstract class have normal methods?
Why do we use polymorphism in oops?
What is the difference between abstraction and polymorphism?
Can private class be inherited?
• What are the desirable attributes for memory managment?
What does and I oop mean in text?
Why we use classes in oop?
Where is pseudocode used?
What is stream in oop?
Write a program to reverse a string using recursive function?
What is encapsulation with example?