1. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 5 sub1(a, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByRef x As Integer, ByVal y As Integer) a += x : x += a : y += a End Sub Function func1(ByRef x As Integer, ByVal y As Integer) As Integer func1 = a + x + y End Function End Module | 2. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 5 sub1(a, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByVal x As Integer, ByRef y As Integer) a += x : x += a : y += a End Sub Function func1(ByVal x As Integer, ByRef y As Integer) As Integer func1 = a + x + y End Function End Module | 3. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 5 sub1(a, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByVal x As Integer, ByVal y As Integer) a += x : x += a : y += a End Sub Function func1(ByVal x As Integer, ByVal y As Integer) As Integer func1 = a + x + y End Function End Module | 4. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 5 Console.WriteLine(func1(a, a)) sub1(5, a) End Sub Sub sub1(ByVal x As Integer, ByVal y As Integer) a += x : x += a : y += a End Sub Function func1(ByVal x As Integer, ByVal y As Integer) As Integer func1 = a + x + y End Function End Module | 5. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 5 sub1(5, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByRef x As Integer, ByVal y As Integer) a += x : x += a : y += a End Sub Function func1(ByRef x As Integer, ByRef y As Integer) As Integer func1 = a + x + y End Function End Module | 6. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 5 Console.WriteLine(func1(a, a)) sub1(a, a) End Sub Sub sub1(ByRef x As Integer, ByVal y As Integer) a += x : x += a : y += a End Sub Function func1(ByRef x As Integer, ByVal y As Integer) As Integer func1 = a + x + y End Function End Module | 7. What is the result? Module Module1 Dim a As Integer = 1 Sub Main() sub1(a, a) Console.WriteLine(func1(a, a) - 4) End Sub Sub sub1(ByRef x As Integer, ByRef y As Integer) a += x : x += a : y += a End Sub Function func1(ByRef x As Integer, ByRef y As Integer) As Integer func1 = a + x + y End Function End Module | 8. What is the result? Module Module1 Dim a As Integer = 1 Sub Main() sub1(a, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByVal x As Integer, ByRef y As Integer) a += x : x += a : y += a End Sub Function func1(ByVal x As Integer, ByRef y As Integer) As Integer func1 = a + x + y End Function End Module | 9. What is the result? Module Module1 Dim a As Integer = 2 Sub Main() sub1(a, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByVal x As Integer, ByVal y As Integer) a += x : x += a : y += a End Sub Function func1(ByRef x As Integer, ByRef y As Integer) As Integer func1 = a + x + y End Function End Module | 10. What is the result? Module Module1 Dim a As Integer Sub Main() Dim a As Integer = 4 sub1(a, a) Console.WriteLine(func1(a, a)) End Sub Sub sub1(ByVal x As Integer, ByRef y As Integer) a += x : x += a : y += a End Sub Function func1(ByVal x As Integer, ByRef y As Integer) As Integer func1 = a + x + y End Function End Module |
|