help

Input two unequal numbers. Display the number after swapping (interchanging) the values of variables without taking any extra variable Eg: a=14, b=25 will be updated as a=25 , b=14
5 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @RonaldMC! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
ayylmao123xdd
ayylmao123xdd6mo ago
you can use simple math or xor
a = a + b;
b = a - b;
a = a - b;
a = a + b;
b = a - b;
a = a - b;
BrokeBoi
BrokeBoiOP6mo ago
thanks
JavaBot
JavaBot6mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot6mo ago
Post Closed
This post has been closed by <@1388045578939797525>.

Did you find this page helpful?