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

Programmingway@Eklavya Technosys!: Class - 7 A or B | Computer | 100 Questions!

Programmingway@Eklavya Technosys!: Class - 7 A or B | Computer | 100 Questions! :  1) What is digital citizenship? 2) What is a digital citi...