Computer Science, asked by harijanbasanti41, 6 months ago

write a JavaScript to input two numbers and display all odd number between them​

Answers

Answered by Anonymous
3

To print odd numbers from 20 to 70 use code given below:

  • function print(){
  • var i;
  • var write = document.getElementsByTagName('h1')[0];
  • for(i = 20; i <= 70; i++){
  • if((i % 2) == 0){
  • continue; //if num is odd, skip it.
  • }
  • write.innerHTML += i + '<br/>';
Similar questions