forked from siddharthsonii/Hack-Fest-22
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base1-swap
36 lines (31 loc) · 982 Bytes
/
base1-swap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a = 10;
cout << "Value of b before: " << b << endl;
// swap values of the variables
swap(a, b);
cout << "Value of a now: " << a << endl;
cout << "Value of b now: " << b << endl;
int a = 10;
cout << "Value of b before: " << b << endl;
int b = 20;
cout << "Value of a before: " << a << endl;
cout << "Value of b before: " << b << endl;
// swap values of the variables
swap(a, b);
cout << "Value of a now: " << a << endl;
cout << "Value of b now: " << b << endl;
int a = 10;
cout << "Value of b before: " << b << endl;
// swap values of the variables
swap(a, b);
cout << "Value of a now: " << a << endl;
cout << "Value of b now: " << b << endl;
int a = 10;
int b = 20;
cout << "Value of a before: " << a << endl;
cout << "Value of b before: " << b << endl;
// swap values of the variables
return 0;