employer cover photo
employer logo
employer logo

Tata Consultancy Services

Fait partie de Tata Group

Employeur impliqué

Question d’entretien chez Tata Consultancy Services

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

Réponse à la question d'entretien

Utilisateur anonyme

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...