From e23e2227a5e397e0569736b2ba854a6fb2c18e6f Mon Sep 17 00:00:00 2001 From: apurv69 <72222883+apurv69@users.noreply.github.com> Date: Sat, 3 Oct 2020 12:32:40 +0530 Subject: [PATCH] Update and rename swap,cpp.cpp to swapping_without_using_third_variable.cpp --- swap,cpp.cpp | 14 --------- swapping_without_using_third_variable.cpp | 38 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 14 deletions(-) delete mode 100644 swap,cpp.cpp create mode 100644 swapping_without_using_third_variable.cpp diff --git a/swap,cpp.cpp b/swap,cpp.cpp deleted file mode 100644 index fe6c824..0000000 --- a/swap,cpp.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -using namespace std; -int main() -{ - int a,b; - cin>>a>>b; - a=a+b; - b=a-b; - a=a-b; - cout< +using namespace std; +void method1(int a,int b){ + a=a+b; + b=a-b; + a=a-b; + cout<<"value of a and b after swapping is: "<>a>>b; +//Using Arithmetic Operators + method1(a,b); + method2(a,b); +//Using Bitwise XOR + method3(a,b); + return 0; + + +}