adplus-dvertising
frame-decoration

Question

Which of the following code skips the first 20 iterations?

a.

for(i in 1:100) {
if(i <= 20) {
next
}
}

b.

for(i in 1:100) {
if(i <= 19) {
next
}
}

c.

for(i in 1:100) {
if(i <= 21) {
next
}
}

d.

for(i in 1:10) {
if(i <= 24) {
next
}
}

Posted under R Programming

Answer: (a).for(i in 1:100) {
if(i <= 20) {
next
}
}

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following code skips the first 20 iterations?