190k views
4 votes
The following JavaScript program is supposed to print: 1 by 4 by 9

on a single line by itself. Unfortunately the program contains at least eight mistakes. Write the corrected line beside the line in error.

var N; // Text
N := 1;
document.writeln( N );
document.writeln( “ by “);
document.writeln( “N + 3”);
document.writeln( “ by “ );
document.writeln( N + 5);

User BBonDoo
by
6.0k points

1 Answer

5 votes

Answer:

var N; // Text

N = 1;

document.write( N );

document.write(" by ");

document.write(N + 3);

document.write(" by ");

document.write(N + 8);

Step-by-step explanation:

var N; // Text

N = 1;

document.write( N );

document.write(" by ");

document.write(N + 3);

document.write(" by ");

document.write(N + 8);

User Ankit Kumar Ojha
by
5.2k points