Hi guyes, This is my first challenge. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Hi guyes, This is my first challenge.

You can use any language.  Please wright a program to swap values of the following variables without using extra variable.  X = 3, Y =4;

7th Dec 2017, 10:44 AM
Dush
Dush - avatar
6 Respuestas
+ 5
https://code.sololearn.com/cZPz6jkWLDMW/#cpp This Programs Swap boths value
7th Dec 2017, 11:29 AM
Akash Pal
Akash Pal - avatar
+ 3
@Dush i like to use your code but with: x=x+y; y=x-y; x=x-y;
7th Dec 2017, 1:34 PM
Mooaholic
Mooaholic - avatar
7th Dec 2017, 4:03 PM
Hrishikesh Kulkarni
Hrishikesh Kulkarni - avatar
+ 1
It is simple, first try yourself, then you can check below: https://code.sololearn.com/ceyQcTWByqzs/?ref=app
7th Dec 2017, 11:26 AM
#RahulVerma
#RahulVerma - avatar
+ 1
im impressed with @#RahulVerma python solution but that's not i was looking for. By the way you can't use temporary variable.
7th Dec 2017, 12:34 PM
Dush
Dush - avatar
+ 1
This is something i was expected. https://code.sololearn.com/cfZ0oXLy24bT/#java
7th Dec 2017, 12:42 PM
Dush
Dush - avatar