Question 11 mark
What does this algorithm output?
count ← 0FOR i ← 3 TO 15 STEP 4count ← count + 1ENDFOROUTPUT count
AQA 3.2.2, OCR 2.2.1 · Programming
Questions for both boards. AQA · OCR · The lesson
What does this algorithm output?
count ← 0FOR i ← 3 TO 15 STEP 4count ← count + 1ENDFOROUTPUT count
What does this algorithm output?
count = 0for i = 3 to 15 step 4count = count + 1next iprint(count)
A program asks for a password until the user types the right one. Which kind of loop fits best?
What does this algorithm output?
n ← 10REPEATn ← n + 5UNTIL n > 8OUTPUT n
What does this algorithm output?
n = 10don = n + 5until n > 8print(n)
What does this algorithm output?
total ← 0x ← 12WHILE x < 10total ← total + xx ← x + 1ENDWHILEOUTPUT total