Skills101
← Pseudocode & Output — Intermediate

Pseudocode & Output Intermediate — Test 1

15 questions22 minPass: 60%+30 XP on first passFree sample test

15 questions · 22 minutes · intermediate level, with a worked solution for every question.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What does this pseudocode print?

    Integer a = 28, b = 8
    while (b != 0)
        Integer t = b
        b = a mod b
        a = t
    end while
    Print a
    
  2. Question 2

    What will be printed? (Arrays start at index 0.)

    Integer arr[5] = {14, 6, 11, 4, 9}
    for (i = 1 to 4)
        arr[i] = arr[i] + arr[i - 1]
    end for
    Print arr[4]
    
  3. Question 3

    What will be printed?

    Integer x = 8
    for (i = 1 to 5)
        x = (x * 3 + 1) mod 7
    end for
    Print x
    
  4. Question 4

    What will be printed? (Arrays start at index 0.)

    Integer arr[5] = {6, 5, 3, 2, 4}
    for (i = 1 to 4)
        arr[i] = arr[i] + arr[i - 1]
    end for
    Print arr[4]
    
  5. Question 5

    How many times is count increased? (What is printed?)

    Integer count = 0
    for (i = 1 to 6)
        for (j = i + 1 to 6)
            count = count + 1
        end for
    end for
    Print count
    
  6. Question 6

    What does this pseudocode print?

    Integer a = 44, b = 8
    while (b != 0)
        Integer t = b
        b = a mod b
        a = t
    end while
    Print a
    
  7. Question 7

    What will be printed? (Arrays start at index 0.)

    Integer arr[5] = {5, 12, 7, 1, 10}
    for (i = 1 to 4)
        arr[i] = arr[i] + arr[i - 1]
    end for
    Print arr[4]
    
  8. Question 8

    What will be printed? (Arrays start at index 0.)

    Integer arr[5] = {10, 6, 7, 12, 5}
    for (i = 1 to 4)
        arr[i] = arr[i] + arr[i - 1]
    end for
    Print arr[4]
    
  9. Question 9

    What does this pseudocode print?

    Integer a = 105, b = 30
    while (b != 0)
        Integer t = b
        b = a mod b
        a = t
    end while
    Print a
    
  10. Question 10

    What will be printed?

    Integer x = 8
    for (i = 1 to 3)
        x = (x * 3 + 1) mod 7
    end for
    Print x
    
  11. Question 11

    What will be printed? (Arrays start at index 0.)

    Integer arr[5] = {13, 14, 7, 2, 1}
    for (i = 1 to 4)
        arr[i] = arr[i] + arr[i - 1]
    end for
    Print arr[4]
    
  12. Question 12

    What does this pseudocode print?

    Integer a = 42, b = 48
    while (b != 0)
        Integer t = b
        b = a mod b
        a = t
    end while
    Print a
    
  13. Question 13

    How many times is count increased? (What is printed?)

    Integer count = 0
    for (i = 1 to 4)
        for (j = 1 to 4)
            count = count + 1
        end for
    end for
    Print count
    
  14. Question 14

    What will be printed? (Arrays start at index 0.)

    Integer arr[5] = {7, 9, 3, 1, 11}
    for (i = 1 to 4)
        arr[i] = arr[i] + arr[i - 1]
    end for
    Print arr[4]
    
  15. Question 15

    What does this pseudocode print?

    Integer a = 99, b = 27
    while (b != 0)
        Integer t = b
        b = a mod b
        a = t
    end while
    Print a
    
🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →