From 195ba4a11673bd12020037bf6c17c6bea7394b84 Mon Sep 17 00:00:00 2001 From: Arunnaman <92690097+Arunnaman@users.noreply.github.com> Date: Mon, 18 Oct 2021 00:20:39 +0530 Subject: [PATCH] Create swap --- Backtracking/swap | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Backtracking/swap diff --git a/Backtracking/swap b/Backtracking/swap new file mode 100644 index 000000000..529877902 --- /dev/null +++ b/Backtracking/swap @@ -0,0 +1,13 @@ +#include +#include + int main() +{ +int a=10, b=20; +printf("Before swap a=%d b=%d",a,b); +a=a*b;//a=200 (10*20) +b=a/b;//b=10 (200/20) +a=a/b;//a=20 (200/10) + system("cls"); +printf("\nAfter swap a=%d b=%d",a,b); +return 0; +}