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 / shubham hajare

#include "stdafx.h"
#include<iostream>
#include<conio.h>
using namespace std;
class stud
{
public:
void add(int a,int b)
{
cout<<a+b;
}

void add(float a,float b)
{
cout<<a+b;
}

void add(int a,float b)
{
cout<<a+b;
}


};
void main()
{
stud a;
a.add(12,12);
a.add(1.2,1.2);
a.add(12,12.2);
_getch();
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

• What are the desirable attributes for memory managment?

2233


What are the three parts of a simple empty class?

2055


What is cohesion in oop?

1062


What are the 4 main oop principles?

1225


what is the sylabus for priliminaries?

2179


What is abstraction in oops with example?

1293


How does polymorphism work?

1140


Is oop better than procedural?

1041


What is difference between polymorphism and inheritance?

1089


Why do pointers exist?

1096


program for insertion ,deletion,sorting in double link list

2691


What does enum stand for?

1122


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1860


What is class in oop with example?

1099


Why we use classes in oop?

1043