
R While Loop Flashcard
Flashcard
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

10 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is the purpose of loops in programming?
Back
To execute a block of code multiple times
2.
FLASHCARD QUESTION
Front
Which of the following is a loop command in R? if, else, while, switch
Back
while
3.
FLASHCARD QUESTION
Front
What will the following R code print?
i <- 1
while (i < 6) {
print(i)
i <- i + 1
}
Back
1 2 3 4 5
4.
FLASHCARD QUESTION
Front
What does the 'break' statement do in a loop?
Back
Stops the loop immediately
5.
FLASHCARD QUESTION
Front
In the context of loops, what does the 'next' statement do?
Back
Skips the rest of the current iteration
6.
FLASHCARD QUESTION
Front
What will the following R code print?
i <- 1
while (i < 6) {
if (i == 4) {
break
}
print(i)
i <- i + 1
}
Options: 1 2 3, 2 3 4 5, 1 2 3 4, 1 2 3 4 5
Back
1 2 3
7.
FLASHCARD QUESTION
Front
What is the output of this R code?
i <- 0
while (i < 6) {
i <- i + 1
if (i == 3) {
next
}
print(i)
}
Back
1 2 4 5 6
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
Genetic Engineering Concepts
Flashcard
•
11th Grade - University
6 questions
EF1T2EM L5U4L1 Restaurant Vocabulary cards
Flashcard
•
11th Grade
8 questions
Mindmap U6-8
Flashcard
•
11th Grade
8 questions
Level 2 Chemistry Flashcards
Flashcard
•
11th Grade
10 questions
Disney descendants flashcard
Flashcard
•
KG
10 questions
Twelfth Night
Flashcard
•
10th Grade
5 questions
Elements of Argumentative Essay
Flashcard
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade