What is the default increment step in a for loop in R?

What is the default increment step in a for loop in R?

a) 1
b) 2
c) 5
d) 0

Answer:

a) 1

Explanation:

In R, the for loop increments by 1 by default when iterating over a sequence like 1:5.

Reference:

R Programming – Loops MCQ Questions and Answers

Scroll to Top