Pergunta de entrevista da empresa Tech Mahindra

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

Resposta da entrevista

Sigiloso

17 de abr. de 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).