Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program in c++ to overload the function add (s1,s2)
where s1 and s2 are integers and floating point values.

Answer Posted / vaibhav munde

#include<iostream.h>
#include<conio.h>
int add(int s1,int s2)
{
return(s1+s2);
}
float add(float a,float b)
{
return(a+b);
}
void main()
{
int s,s1,s2;
float a,b,c;
clrscr();
cout<<"\n Enter two integer number:";
cin>>s1>>s2;
s=add(s1,s2);
cout<<"Addition of two Integer number:"<<s;
out<<"\n Enter two float number:";
cin>>a>>b;
c=add(a,b);
cout<<"Addition of two Float number:"<<c;
getch();

}

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better struts or spring?

1063


What is class in oop with example?

1107


How do you define a class in oop?

1129


What is polymorphism give a real life example?

1040


What is a null tree?

1144


What is overriding vs overloading?

1070


What is protected in oop?

1087


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2624


What is advantage of inheritance?

1177


What is the highest level of cohesion?

1056


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4757


Prepare me a program for the animation of train

2478


Which is not an object oriented programming language?

1003


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

2221


What is oops and its features?

1089