Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
Two loops start with the same value. How many times does each loop body run, and what is output?
Computer Science
Medium
High School (9–10)
Algorithms, Programming and Logic › Programming
IGCSE
Created by
StemPy Lab
Two loops start with the same value.
DECLARE Level : INTEGER Level ← 50 WHILE Level < 20 DO Level ← Level + 10 ENDWHILE REPEAT Level ← Level + 10 UNTIL Level > 20 OUTPUT Level
How many times does each loop body run, and what is output?
WHILE 0 times, REPEAT 0 times, output
50
WHILE 1 time, REPEAT 0 times, output
60
WHILE 1 time, REPEAT 1 time, output
70
WHILE 0 times, REPEAT 1 time, output
60
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← Two values are compared with logical operators. What is output?
A countdown uses a FOR loop with a negative step. How many values are output? →
More on
Algorithms, Programming and Logic › Programming
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
A long scenario question. A teacher has the names of 5 students in the file Names.txt, one name a…
Hard
Shopping.txt holds six lines: bread, rice, milk, eggs, tea and jam…
Medium
The file Best.txt holds one line: 120. What is output, and what does Best.txt hold afterwards, when…
Easy
The nine squares of a board are input row by row: X, O, O, then X, X, X, then O, a dot for an empty…
Hard
All problems on this topic →