write a program for function overloading?
Answer Posted / sudesh kumar
#include<iostream.h>
#include<conio.h>
void add(int,int);
void add(int);
void main()
{
int a,b;
cout<<"enter two no";
cin>>a>>b;
add(a,b);
add(a);
getch();
}
void add(int x,int y)
{
int z;
z=x+y;
cout<<"the sum is "<<z;
}
void add(int x)
{
int z;
z=x*x;
cout<<"the sequre is A value"<<z;
}
Is This Answer Correct ? | 37 Yes | 11 No |
Post New Answer View All Answers
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
what type of questions
What is basic concept of oop?
Whats oop mean?
What are functions in oop?
Why is polymorphism important in oop?
What is a class and object?
What are the two different types of polymorphism?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What is difference between class and object with example?
Why interface is used?
What is the fundamental idea of oop?
Can private class be inherited?
Why do we use oops?
What is encapsulation selenium?