Computer Science, asked by bipint6410, 10 months ago

Using continue display the odd numbers between 1 to 20.

Answers

Answered by tishtha0902007
0

Answer:

1

3

5

7

9

11

13

15

17

19 .......

hope so it will help you

Answered by shilpa85475
0

Code for a continue display  is given below .

EXPLANATION:  

‘Continue’ will not terminate the loop. It is used to skip the statement following it, if given condition is satisfied. It then executes the loop with next iteration.

function print(){

var i;

var write = document.getElementsByTagName('h1')[0];

for(i = 1; i <= 20; i++){

  if((i % 2) == 0){

   continue; //if number is odd, it will skip it.

  }

  write.innerHTML += i + '<br/>';

}

}

print();

Similar questions