1#include <stdio.h>
2
3void swap(int*, int*);
4
5int main()
6{
7 int x, y;
8
9 printf("Enter the value of x and y\n");
10 scanf("%d%d",&x,&y);
11
12 printf("Before Swapping\nx = %d\ny = %d\n", x, y);
13
14 swap(&x, &y);
15
16 printf("After Swapping\nx = %d\ny = %d\n", x, y);
17
18 return 0;
19}
20
21void swap(int *a, int *b)
22{
23 int temp;
24
25 temp = *b;
26 *b = *a;
27 *a = temp;
28}
29