Module Module1 ' recursive function to find factorial n Function calcFactorial(ByVal n As Integer) As Integer Dim factorial As Integer Console.WriteLine(String.Format("n={0}", n)) If (n = 0) Then factorial = 1 Else factorial = n * calcFactorial(n - 1) End If Console.WriteLine(String.Format("At line A {0}", factorial)) Return factorial End Function Sub Main() Dim x As Integer Dim eat As String x = calcFactorial(4) Console.WriteLine(String.Format("At line B {0}", x)) Console.WriteLine("Any key to continue") eat = Console.ReadLine() End Sub End Module