Swap two numbers without using third variable in java #java #program #java4quicklearning

preview_player
Показать описание
Swap two numbers without using third variable in java #java #program #java4quicklearning

swap two numbers without using third variable,swap two numbers in java,swap two numbers,swap two numbers without using three variables,swap two variables without using third variable,swap two numbers without using third variable in c,java program to swap two numbers without using third variable,swapping of two numbers without using third variable,without using third variable,how to swap two numbers in java,swap two numbers without third variable
Рекомендации по теме
Комментарии
Автор

Smart people struggle for simplicity while foolish people admire complexity.

BobRichardson-sy
Автор

The first 1 is cool but the second is how good software is written 😎

RickoDeSea
Автор

Doesn't work on floating point numbers and only useful for learning bitwise operators. Has no real life application.

ortezan
Автор

Second one will get corrected to the first one and give the exact same output in most compilers.

mikkel
Автор

Yes was asked in Morgan Stanley (MSCI)

dxcfvghkjtyujk
Автор

Addition and subtraction is also a option

storagekb
Автор

Let A =10
Let B= 20
a = a + b // a become 30
b = a - b // b becom 10
a = a - b a becom 20

Consol.log(a, b)

Rvwondervlog
Автор

Unless you need to swap two nos which are zero

shauryakrishna
Автор

I'll remember this next time I'm writing code and only have 128B of RAM

austinnar
Автор

Answer both temp=b=a....so answer is A

shahid
Автор

In the very basic, why we need to swap 2 numbers anyway?

masdd
Автор

I dont think the first one is correct if a=1 and b=2 then the ans becomes a=1 and b=1
Maybe I am wrong so I am ready to accept it as well

Akalpmishra
Автор

I don't get tge first one, what is that ^?

I mean, in JS is exponentiation...

realjoker
Автор

The first one is not working if a=5
B=2

DeepGuhaThakurata
Автор

I just spent 30 mins and realized this is wrong.. the final value will never be same as original value.. what an idiot

ssabt
visit shbcf.ru