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

What are the three main types of variables?

597


write a program to find 2^n+1 ?

1540


any one please tell me the purpose of operator overloading

1962


to find out the minimum of two integer number of two different classes using friend function

1635


Is abstract thinking intelligence?

590






What is the important feature of inheritance?

631


Why do we use oop?

597


Why do we need oop?

656


Why is polymorphism used?

577


can we make game by using c

3411


What is multilevel inheritance explain with example?

621


What is advantage of inheritance?

685


what type of question are asked in thoughtworks pair programming round ?

1754


What is object in oops?

608


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1535