logo CodeStepByStep logo

ParameterMysteryExam5

Language/Type: VB parameters return

The following console program uses parameters and produces four lines of output. What are they?

Public Module ParameterMysteryExam5
    Public Sub Main()
        Dim a As Integer = 10
        Dim b As Integer = 4
        Dim c As Integer = a + b

        Dim d As Integer = Mystery(a, b, c)
        b -= 1
        c = Mystery(c, d, a)
        Mystery(a, c, b)
        Console.WriteLine(a & " " & b & " " & c & " " & d)
    End Sub

    Public Function Mystery(b As Integer, c As Integer, a As Integer)
        c += 1
        Console.WriteLine(c & " " & a & " " & b)
        Return a + 2
    End Function
End Module
line 1
line 2
line 3
line 4

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.