Skip to content

Commit

Permalink
10 | 1 | sharafat
Browse files Browse the repository at this point in the history
  • Loading branch information
SharafatKarim committed Aug 4, 2023
1 parent 2df2898 commit 994b9f0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions solutions/sharafat/10/1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>

int a = 10, b = 20;

void swap (void)
{
b = a + b ;
a = b - a ;
b = b - a ;
}

int main()
{
printf("Before swap: a = %d, b = %d\n", a, b);
swap();
printf("After swap: a = %d, b = %d\n", a, b);
return 0;
}

0 comments on commit 994b9f0

Please sign in to comment.