Skip to content

Commit 4d35595

Browse files
authored
_8a.2.pointerswap.c
1 parent 7bfd387 commit 4d35595

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

_8a.2.pointerswap.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <stdio.h>
2+
void swap(int *c, int *d)
3+
{
4+
int s=*c;
5+
*c=*d;
6+
*d=s;
7+
}
8+
9+
10+
11+
int main()
12+
{
13+
int a,b;
14+
printf("Value of a \n");
15+
scanf("%d", &a);
16+
printf("Value of b \n");
17+
scanf("%d", &b);
18+
swap(&a,&b);
19+
printf("\n Swapped Values \n a= %d b= %d",a,b);
20+
return 0;
21+
}

0 commit comments

Comments
 (0)