Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

swap two numbers without using third variable

var a=window.prompt('enter a number')var b=window.prompt('enter a number')var a=a+b;var b=a-b;var a=a-b;console.log ("value of a is",a);console.log('value of b is',b);
Source by pujasharma5431.medium.com #
 
PREVIOUS NEXT
Tagged: #swap #numbers #variable
ADD COMMENT
Topic
Name
5+4 =