Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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
8+3 =