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 / deepa mathur

include <iostream.h>

void add (int s1, int s2)
{
int s3;
s3= s1 + s2;
cout<<"sum of 2 no. is= "<< s3;
}

void add (float s1, float s2)
{
float s3;
s3 = s1 + s2;
cout<<" sum of 2 no. is= "<< s3;
}

void main
{
void add (int a, int b);
void add (float a, float b);
add(30, 20);
add (30.5, 56.7);
getch();
}

Is This Answer Correct ?    47 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is oops and why we use oops?

1024


Can we create object of abstract class?

1070


How do you explain polymorphism?

1059


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

2302


What is the full form of oops?

1167


What is destructor in oop?

1020


What is polymorphism in oop example?

1005


What is polymorphism and why is it important?

1027


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1913


how to get the oracle certification? send me the answer

2146


What are the 4 pillars of oop?

1127


Get me an image implementation program.

1971


What is the real life example of polymorphism?

1154


Why do we use oops?

1002


what is different between oops and c++

2520