Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

swapping data of two variable without third one

X= 25 (First number), Y= 23 (second number)
Swapping Logic:
X = X + Y = 25 +23 = 48
Y = X - Y = 48 - 23 = 25
X = X -Y = 48 - 25 = 23
and the numbers are swapped as X =23 and Y =25.
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #swapping #data #variable
ADD COMMENT
Topic
Name
7+1 =