Polymorphism In Cpp

in Hindi - Polymorphism In Cpp



not yet

Source Code :

RUN#include <iostream.h>
#include <conio.h>

class Numbers{
    
private:
int num1,num2,num3;

public:
Numbers()
{
num1=0;
num2=0;
num3=0;
}
void getdata()
{
cout<<"
Enter numbers of co-ordinates of the point : "<<endl;
cout<<"num1 : ";
cin>>num1;
cout<<"
num2 : ";
cin>>num2;
cout<<"
num3 : ";
cin>>num3;
}
void operator++()
{
num1++;
num2++;
num3++;
}
void putdata()
{
cout<<"
num1 ="<<num1<<"
num2 ="<<num2<<"
num3 ="<<num3;
}
};
int main(){
Numbers N;
N.putdata();
N.getdata();
++N;
cout<<"
Incremented values";
N.putdata();
return 0;
}