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

explain sub-type and sub class? atleast u have differ it into 4 points?

1832


What is abstraction in oops with example?

774


What are the important components of cohesion?

552


What is stream in oop?

837


What does and I oop mean?

614






What is abstraction with example?

606


write knight tour problem which is present in datastructure

2164


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1983


What are the three parts of a simple empty class?

1459


How do you define a class in oop?

628


What is inheritance in simple words?

625


What is coupling in oops?

595


What is the main purpose of inheritance law?

667


What is use of overloading?

608


What type of loop is a for loop?

682