Question d’entretien chez Tech Mahindra

In C# how would you swop the values in two variables without using a third variable.

Réponse à la question d'entretien

Utilisateur anonyme

17 avr. 2025

In C# how would you swop the values in two variables without using a third variable. I combined the values of the two variables into the second variables and used indexof with a delimitator to get the first variable value. While it would work it wasn't what the interviewer was looking for. CORRECT ANSWER: TUPLE SWAP (a, b)=(b,a).