Friday, July 4, 2014

VB.NET CODE FOR FUNCTION


Module Module1
    Sub Main()
Dim i As Integer = 5
        Dim j, res As Integer
        res = fun(i, j)
        Console.WriteLine(j & " " & res)
        Console.ReadKey()
    End Sub

    Function fun(ByVal x As Integer, ByRef y As Integer) As Integer
        y = x * x
        Return x * x * x
    End Function
End Module

output
25 125

No comments:

Post a Comment

Make Code Arcade : Area of Circle

  Make Code Arcade : Area of Circle Editor Simulator