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


Please Help Members By Posting Answers For Below Questions

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

1631


what type of questions

1701


What is basic concept of oop?

714


Whats oop mean?

609


What are functions in oop?

595






Why is polymorphism important in oop?

643


What is a class and object?

606


What are the two different types of polymorphism?

679


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

1847


What is difference between class and object with example?

574


Why interface is used?

565


What is the fundamental idea of oop?

648


Can private class be inherited?

631


Why do we use oops?

603


What is encapsulation selenium?

562