Program: 6: Function overloading
AIM:
To write a C++ program to illustrate the concept of function overloading.
PSEUDOCODE:
#include <iostream>
using namespace std;
class Sum{
public:
int add(int a,int b){
return a+b;
}
float add(float a,float b){
return a+b;
}
};
int main(){
Sum s;
cout<<"Integer sum = "<<s.add(10,20)<<endl;
cout<<"Float sum = "<<s.add(10.5f,20.4f)<<endl;
}
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
Get Answers For Free
Most questions answered within 1 hours.