Pregunta de entrevista de Tata Consultancy Services

how to swap 2 numbers without using third variable in c programming?

Respuesta de la entrevista

Anónimo

26 nov 2015

I knew the solution to this question. So it was easy for me to answer this. The logic is to take sum of the numbers and store it in one of the two variables. then the logic goes like below... a=a+b; b=a-b; a=a-b; check this by simple example....it works...