11. How is a do-while loop implemented in R?
12. In R, what does the if (condition) { code_block } else { code_block } statement do?
13. How is the repeat loop terminated in R?
14. What is the purpose of the which() function in R?
15. How do you create a vector containing the first 5 positive even numbers in R using a loop?
16. What is the output of the following R code: for (i in 1:5) { if (i %% 2 == 0) { print(i) } }
17. In R, what is the purpose of the repeat loop combined with break?
18. How is the switch() function different from if-else in R?
19. What is the role of the next statement in a loop in R?
20. In R, what does the repeat loop combined with next do?
Read More Section(Control Structures in R Programming)
Each Section contains maximum 100 MCQs question on Control Structures in R Programming. To get more questions visit other sections.