From dddb3fc0ec62d3b58be6f734a4aa4e8f7d707a6f Mon Sep 17 00:00:00 2001 From: GaganDeepSingla <56605474+GaganDeepSingla@users.noreply.github.com> Date: Wed, 16 Oct 2019 00:17:49 +0530 Subject: [PATCH] Swap Without Using Third Variable This Program implements Swapping of Variables without the use of a Third Variable --- .../Swap Without Third Variable.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Swap-without-third-variable/Swap Without Third Variable.txt diff --git a/Swap-without-third-variable/Swap Without Third Variable.txt b/Swap-without-third-variable/Swap Without Third Variable.txt new file mode 100644 index 0000000..8aa0267 --- /dev/null +++ b/Swap-without-third-variable/Swap Without Third Variable.txt @@ -0,0 +1,13 @@ +#include +#include + int main() +{ +int a=600, b=500; +printf("Before swap a=%d b=%d",a,b); +a=a*b; +b=a/b; +a=a/b; +system("cls"); +printf("\nAfter swap a=%d b=%d",a,b); +return 0; +} \ No newline at end of file