Write a JavaScript program for swapping of two numbers
https://www.computersprofessor.com/2016/06/write-javascript-program-for-swapping.html
<html>
<head>
<title> swapping < /title>
<script language = “Javascript”>
var a, b;
a = parseInt (window. prompt (“enter a value”, “0”));
b = parseInt (window. prompt (“ enter b value”, “0”));
document.write (“ values before swapping a = “ + a + “ b = “+ b );
a = a + b;
b = a – b;
a = a – b;
document.write (“< h1 value after swapping a = “ + a+” b = “+b + “ < /h1>);
< /script>
< /head>
< body > < /body>
< /html>
(or)
<html>
<head>
<title> swapping < /title>
<script language = “Javascript”>
var a, b;
a = parseInt (window. prompt (“enter a value”, “0”));
b = parseInt (window. prompt (“ enter b value”, “0”));
document.write (“ values before swapping a = “ + a + “ b = “+ b );
a = a * b;
b = a/b;
a = a/b;
document.write (“< h1 value after swapping a = “ + a+” b = “+b + “ < /h1>);
< /script>
< /head>
< body > < /body>
< /html>
