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);

11th Jan 2022, 8:05 AM
Logician S
Logician S - avatar
2 Answers
+ 7
document.write("A =" + x+"</br>"); ....
11th Jan 2022, 8:10 AM
Simba
Simba - avatar
+ 4
You forgot to copy <y> to <x> without this swap won't work temp = x; x = y; y = temp;
11th Jan 2022, 8:12 AM
Ipang