Understanding Loops in Programming
Quiz
•
Computers
•
University
•
Medium
Ayu Normashidayu
Used 5+ times
FREE Resource
Enhance your content in a minute
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a loop in programming?
A function that returns a value
A programming construct that repeats a block of code until a specified condition is met
A way to display output
A way to store variables
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the types of loops in C++?
For, While, Do-while
Repeat, Until, Loop
If, Else, For
Do, While, Repeat
3.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does this for loop do? for (int i = 1; i <= 5; i++) { cout << i << endl; }
Prints numbers from 1 to 6
Prints numbers from 1 to 5
Prints 5 lines of text
Prints numbers from 0 to 5
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does a while loop work?
It runs indefinitely regardless of the condition
It checks the condition after the loop body executes
It checks the condition before executing the loop body
It runs for a fixed number of times
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does this do-while loop do? int i = 1; do { cout << i << endl; i++; } while (i <= 5);
Prints numbers from 1 to 4
Prints numbers from 1 to 5
Prints 5 lines of text
Prints numbers from 0 to 5
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a while loop and a do-while loop?
The while loop is faster
The do-while loop runs at least once before checking the condition
The while loop checks the condition after each iteration
There is no difference
7.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does this code do? int sum = 0; for (int i = 1; i <= 10; i++) { sum += i; } cout << "Sum: " << sum << endl;
Prints the sum of numbers from 1 to 9
Prints the sum of numbers from 1 to 10
Prints the numbers from 1 to 10
Prints the sum of numbers from 0 to 10
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
Kiến Trúc Máy Tính from Nhóm 5
Quiz
•
University
20 questions
PHP First Internal Practical Viva
Quiz
•
University
20 questions
quizz tkinter
Quiz
•
11th Grade - University
20 questions
Grade 7 Python Programming Quiz
Quiz
•
7th Grade - University
20 questions
TEST FINAL - Configuración de Servicios Windows
Quiz
•
University
20 questions
quiz for operating system,Iot,Data science
Quiz
•
University
20 questions
Infrastructure (Network)
Quiz
•
University
20 questions
C Quest 2.0
Quiz
•
University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
12 questions
Halloween
Quiz
•
3rd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
History of Halloween: Pagan or Christian?
Interactive video
•
11th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
