logo CodeStepByStep logo

LoopMysteryExam5

Language/Type: VB while return

For each call of the subroutine below, write the output that is printed as it would appear on the console.

Public Sub LoopMysteryExam5(x As Integer, y As Integer)
    Dim z As Integer = y
    While x Mod z = 0
        Console.Write("(" & x & " " & z & ") ")
        x = x - z
        z += 1
    End While
    Console.WriteLine("(" & x & " " & z & ") " & y)
End Sub
LoopMysteryExam5(12, 4)
LoopMysteryExam5(14, 2)
LoopMysteryExam5(27, 3)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.