Skills101
← Pseudocode & Output — Advanced

Pseudocode & Output Advanced — Test 1

15 questions30 minPass: 60%+40 XP on first passFree sample test

15 questions · 30 minutes · advanced 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 is printed? (^ is bitwise XOR, << is left shift)

    Integer a = 24, b = 26
    Integer c = (a ^ b) << 1
    Print c
    
  2. Question 2

    What does this recursive pseudocode print?

    Integer fun(Integer x)
        if (x <= 1) return 1
        return fun(x - 1) + fun(x - 2)
    End
    Print fun(6)
    
  3. Question 3

    What does this pseudocode print?

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

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

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

    What does this recursive pseudocode print?

    Integer fun(Integer x)
        if (x <= 0) return 0
        return x + fun(x - 2)
    End
    Print fun(6)
    
  6. Question 6

    What does this pseudocode print?

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

    What does this pseudocode print?

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

    What does this pseudocode print?

    Integer a = 72, b = 64
    while (b != 0)
        Integer t = b
        b = a mod b
        a = t
    end while
    Print a
    
  9. Question 9

    What is printed? (& is bitwise AND, << is left shift)

    Integer a = 19, b = 26
    Integer c = (a & b) << 2
    Print c
    
  10. Question 10

    What is printed? (^ is bitwise XOR, << is left shift)

    Integer a = 24, b = 12
    Integer c = (a ^ b) << 2
    Print c
    
  11. Question 11

    What is printed? (& is bitwise AND, << is left shift)

    Integer a = 29, b = 18
    Integer c = (a & b) << 1
    Print c
    
  12. Question 12

    What is printed? (| is bitwise OR, << is left shift)

    Integer a = 21, b = 12
    Integer c = (a | b) << 1
    Print c
    
  13. Question 13

    What does this pseudocode print?

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

    What does this recursive pseudocode print?

    Integer fun(Integer x)
        if (x <= 0) return 0
        return x + fun(x - 2)
    End
    Print fun(5)
    
  15. Question 15

    What does this recursive pseudocode print?

    Integer fun(Integer x)
        if (x <= 1) return 1
        return fun(x - 1) + fun(x - 2)
    End
    Print fun(7)
    
🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →