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.


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 1 of 13

Answer: (a).if(<condition>) {
## do something
else {
## do something else
Answer: (c).The if/else statement conditionally evaluates two statements
Answer: (a).while ( statement1 ) statement2
Answer: (a).x <- runif(1, 0, 10)
if(x > 3) {
y <- 10
} else {
y <- 0
Answer: (b).break will execute a loop while a condition is true
_______ is used to break the execution of a loop.
Answer: (c).break
Answer: (c).> for(i in 1:10) {
+ print(i)
+ }
Which of the following statement can be used to explicitly control looping?
Answer: (c).break
Which of the following should be preferred for evaluation from list of alternatives?
Answer: (b).eval
What will be the output of the following R code?
> x <- c("a", "b", "c", "d")
> for(i in 1:4) {
    + ## Print out each element of 'x'
    + print(x[i])
+ }
Answer: (a).[1] "a"
[1] "b"
[1] "c"
[1] "d"
Page 1 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!