Question d’entretien chez Comviva

Write pseudocode to swap two numbers without third variable .

Réponses aux questions d'entretien

Utilisateur anonyme

10 mars 2022

solution is to use the XOR method (addition method will cause integer overflow for big values) a = a ^ b b = a ^ b a = a ^ b

Utilisateur anonyme

17 août 2022

STEP 1: START. STEP 2: ENTER x, y. STEP 3: PRINT x, y. STEP 4: x = x + y. STEP 5: y= x - y. STEP 6: x =x - y. STEP 7: PRINT x, y. STEP 8: END.