Skip to content

Commit

Permalink
Create Swap Numbers.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
srravigupt committed Oct 2, 2022
1 parent 97265a4 commit 7f33783
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Swap Numbers.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
using namespace std;

int main()
{
int a = 5, b = 10, temp;

cout << "Before swapping." << endl;
cout << "a = " << a << ", b = " << b << endl;

temp = a;
a = b;
b = temp;

cout << "\nAfter swapping." << endl;
cout << "a = " << a << ", b = " << b << endl;

return 0;
}

0 comments on commit 7f33783

Please sign in to comment.