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
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
explain sub-type and sub class? atleast u have differ it into 4 points?
What is the difference between a mixin and inheritance?
Which language is not a true object oriented programming language?
What are constructors in oop?
What are the advantages of polymorphism?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
State what is encapsulation and friend function?
Write a c++ program to display pass and fail for three student using static member function
How can you overcome the diamond problem in inheritance?
What is oops?what is its use in software engineering?
Can destructor be overloaded?
What is object and example?
Why is there no multiple inheritance?
Can static class have constructor?