0
How to get breaks in the lines?
Here is a code: var x=5; var y=10; var temp=0; document.write("A =" + x); document.write(" B =" + y); temp=x; y=temp; document.write(" After swap:"); document.write(" A=" + x); document.write(" B=" + y);
2 Answers
+ 7
document.write("A =" + x+"</br>");
....
+ 4
You forgot to copy <y> to <x> without this swap won't work
temp = x;
x = y;
y = temp;