Computer Science, asked by jshivani2805, 2 months ago

write a javascript for loop that will iterate from 0 to 15​

Answers

Answered by harshini196
1

Explanation:

hope help full to you please make me bralinist votes

Attachments:
Answered by anindyaadhikari13
2

Required Answer:-

Question ?

  • Write a JavaScript for loop that will iterate from 0 to 15.

Solution:

This is the c∅de for the loop that iterates from 0 to 15.

for (var i=0;i<=15;i++) {

}

To print the numbers in the given range, write -

for (var i=0;i<=15;i++) {

console.log(i);

}

Note:

Syntax of for loop:

for(initialisation; text-condition; update-expression) {

statement1;

statement2;

.

.

statementn;

}

If there is only 1 statement inside for loop, then there is no need of writing { and }.

For example,

for(var i=0;i<=15;i++)

console.log(i);

Similar questions