From 47de737c1879add52354610dcce3818e9b46e1bc Mon Sep 17 00:00:00 2001 From: imdevil69 <76860472+imdevil69@users.noreply.github.com> Date: Sat, 30 Oct 2021 00:15:12 +0530 Subject: [PATCH] Update in swap two numbers Swap two numbers without using third variable. --- Swap_two_numers.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Swap_two_numers.cpp b/Swap_two_numers.cpp index 917c1be..1c06a8a 100644 --- a/Swap_two_numers.cpp +++ b/Swap_two_numers.cpp @@ -1,15 +1,12 @@ -#include -using namespace std; -int main() -{ - cout << "Enter two Numbers " << endl; - int a; - int b; - cin >> a >> b; - cout << "Before swap a= " << a << " b= " << b << endl; - a = a * b; - b = a / b; - a = a / b; - cout << "After swap a= " << a << " b= " << b << endl; - return 0; -} \ No newline at end of file + #include +using namespace std; +int main() +{ +int a=5, b=10; +cout<<"Before swap a= "<