Write a Javascript code to print Odd Numbers between two Numbers.

Write a Javascript code to print Odd Numbers between two Numbers.

<!DOCTYPE html>
<html>
<head>
<P>Odd Numbers are....</p>
<script language="Javascript">
var n,x;
x=prompt("Input initial Number...");
n=prompt("Input the Number...");
for(x;x<=n;x++)
{
if(x%2!=0)
{
document.write(x+"<br>");
}
}
</script>
 </head>
</html>

2 comments: