From 994b9f07d216a97569bfde27e6a5bf9e2a310d71 Mon Sep 17 00:00:00 2001 From: SharafatKarim Date: Fri, 4 Aug 2023 15:27:34 +0600 Subject: [PATCH] 10 | 1 | sharafat --- solutions/sharafat/10/1.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 solutions/sharafat/10/1.c diff --git a/solutions/sharafat/10/1.c b/solutions/sharafat/10/1.c new file mode 100644 index 0000000..f145b66 --- /dev/null +++ b/solutions/sharafat/10/1.c @@ -0,0 +1,18 @@ +#include + +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; +} \ No newline at end of file