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 type of loop is a for loop?

1048


What is data binding in oops?

1024


Why do we need oop?

1103


What causes polymorphism?

1068


What is coupling in oop?

968


any one please tell me the purpose of operator overloading

2339


Where You Can Use Interface in your Project

1834


What are the 4 pillars of oop?

1089


How do you define a class in oop?

1060


What is this pointer in oop?

999


What is a function in oop?

1018


What is multilevel inheritance?

1152


How to improve object oriented design skills?

948


• What are the desirable attributes for memory managment?

2166


What does no cap mean?

1008