diff --git a/classes_and_objects/main.cpp b/classes_and_objects/main.cpp index deb49cb..0fe68d4 100644 --- a/classes_and_objects/main.cpp +++ b/classes_and_objects/main.cpp @@ -1,14 +1,35 @@ //program to swap two numbers #include using namespace std; - + class Sample{ - // define your class here -}; + + int x,y; + public: + int temp; + void getdata(){ + cout<<"Enter the first number= "; + cin>>x; + cout<<"Enter the secound number= "; + cin>>y; + } + void showdata(){ + temp=x; + x=y; + y=temp; + cout<<"The value of first number is now= "<