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 for function overloading?

Answer Posted / raja

#include<iiostream.h>
class overload
{
public:
int sum(int,int);
float sum(float,float);
};
int overload::sum(int num1,int num2)
{
return num1 + num2;
}
}
float overload::sum(float num1,float num2)
{
return num1+ num2
}
}
int main(90
{
overload o1;
cout<<"o1.sum(5.4f,8.6f)<<endl;
cout<<"o1.sum(19,34)<<endl;
}

Is This Answer Correct ?    28 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantages of inheritance.

1076


How do you achieve runtime polymorphism?

994


What is overloading and its types?

1079


Why is oop useful?

1033


Write a c++ program to display pass and fail for three student using static member function

3326


• What are the desirable attributes for memory managment?

2167


What is polymorphism used for?

1015


class type to basic type conversion

2338


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

2193


can inline function declare in private part of class?

4303


How does polymorphism work?

1077


can we make game by using c

4036


What is the purpose of enum?

965


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

1810


What language is oop?

962