I have a homework:
import 3 numbers
n,m,k. Count all numbers betweenmandndivisible byk
And this is my code, can anyone tell me what is wrong with that?
var n = parseInt(prompt("enter N"));
var m = parseInt(prompt("enter M"));
var k = parseInt(prompt("enter K"));
for (var i=0; n<=i<=m; i++)
{
if (i % k == 0)
{
document.write( i + ' ');
}
}
document.writeis very very rarely used in modern javascript. You would do best to forget that it even exists