Swap two numbers without using third variable
Utilisateur anonyme
// Let the two numbers be a and b a = a + b; // Step 1: Add both numbers b = a - b; // Step 2: Subtract b from the sum to get a a = a - b; // Step 3: Subtract the new b from the sum to get b