Skip to content

Commit

Permalink
Merge pull request #22 from lakshyadeepgogoi/patch-1
Browse files Browse the repository at this point in the history
Updated  Classes and object
  • Loading branch information
ShaileshKumar007 committed Oct 11, 2022
2 parents 1fb09f5 + 557d877 commit d33a011
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions classes_and_objects/main.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
//program to swap two numbers
#include<iostream>
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= "<<x<<endl;
cout<<"The value of secound number is now= "<<y;

}
};

//Driver Code
int main()
{
// implement the use of objects here
return 0;

Sample s;
s.getdata();
s.showdata();

return 0;
}

0 comments on commit d33a011

Please sign in to comment.