adplus-dvertising

Welcome to the Control Structures and Functions MCQs Page

Dive deep into the fascinating world of Control Structures and Functions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Control Structures and Functions, a crucial aspect of R Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Control Structures and Functions, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within R Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Control Structures and Functions. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of R Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Control Structures and Functions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Control Structures and Functions MCQs | Page 2 of 13

Discuss
Answer: (a).for(i in 1:100) {
if(i <= 20) {
next
}
}
Discuss
Answer: (d).All of the mentioned
Q13.
_________ initiates an infinite loop right from the start.
Discuss
Answer: (b).repeat
Discuss
Answer: (a).for(i in 1:100) {
print(i)
if(i > 20) {
break
}
}
Discuss
Answer: (a).Statements cannot be grouped together using braces ‘{’ and ‘}’
Q16.
_______ is used to skip an iteration of a loop.
Discuss
Answer: (a).next
Q17.
Which of the following R code can be used to avoid numeric problems such as taking the logarithm of a negative number?
Discuss
Answer: (b).if( any(x <= 0) ) y <- log(1+x) else y <- log(x)
Q18.
R has ________ statements that provide explicit looping.

a.

2

b.

3

c.

4

d.

5

Discuss
Answer: (b).3
Q19.
The syntax of the repeat loop is _________
Discuss
Answer: (b).repeat statement
Q20.
What will be the output of the following R code?
> x <- 3
> switch(x, 2+2, mean(1:10), rnorm(5))
Discuss
Answer: (a).2.2903605 2.3271663 -0.7060073 1.3622045 -0.2892720
Page 2 of 13

Suggested Topics

Are you eager to expand your knowledge beyond R Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!