Loading...
Is this your company?
How to swap the values in 2 variables without using a temporary variable.
Anonymous
a=a^b b=b^a a=a^b
but it should say swap two integers! because this XOR won't work with float for example
This works for floats: a = a+b b = a-b a = a-b But you might overflow on a+b.
push and pop the values from the stack.
While using the XOR method, add condition to check if numbers are same. If they are same, XOR results in 0.
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.