#include<iostream.h>
#include<conio.h>
class overloading
{
public:
                int sum(int a,int b)
                                {
                                return (a+b);
                                }
                void sum(int c,float d)
                                {
                                cout<<"Sum = "<<c+d<<endl;
                                }
};
void main()
{
                int x=15,y=20,sum;
                float z=25.5;
                overloading f;
                clrscr();
                f.sum(x,z);
                sum=f.sum(x,y);
                cout<<"Sum = "<<sum<<endl;
                getch();
}

159.PNG

Advertisements