Est-ce votre entreprise ?
How to swap the values in 2 variables without using a temporary variable.
Utilisateur anonyme
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.
Tenez-vous au courant des dernières opportunités et profitez de conseils d’initiés en suivant les entreprises de vos rêves.
Obtenez des recommandations et des mises à jour personnalisées en démarrant vos recherches.