# 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

Q1.
Which of the following is valid syntax for if else statement in R?
## do something
}
else {
## do something else
}
Q2.
Point out the correct statement?
Answer: (c).The if/else statement conditionally evaluates two statements
Q3.
Which of the following R syntax is correct for while loop?
Answer: (a).while ( statement1 ) statement2
Q4.
Which of the following R code generate a uniform random number?
Answer: (a).x <- runif(1, 0, 10)
if(x > 3) {
y <- 10
} else {
y <- 0
}
Q5.
Point out the wrong statement?
Answer: (b).break will execute a loop while a condition is true
Q6.
_______ is used to break the execution of a loop.
Q7.
Which of the following R code generate a sequence of integers from 1 to 10?
Answer: (c).> for(i in 1:10) {
+ print(i)
+ }
[1]
Q8.
Which of the following statement can be used to explicitly control looping?
Q9.
Which of the following should be preferred for evaluation from list of alternatives?
Q10.
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])
+ }