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 constructor in oop?
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.
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is new keyword in oops?
What is the types of inheritance?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
How do you answer polymorphism?
What is a function in oop?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< Describe these concepts: Polymorphism, Inheritance and Abstraction. Why polymorphism is used in oops? Which is not an object oriented programming language? What is overriding vs overloading? What is class and object in oops?