How to create Function in vb.net

Total Post:341

Points:2389
VB.Net 
 1062  View(s)
Ratings:
Rate this:
I want to use function in vb.net .please help me.
  1. Post:286

    Points:2044
    Re: How to create Function in vb.net

     A Function returns a value. It uses a special syntax form in the VB.NET language. The Function optionally accepts one or more parameters—these are called formal parameters.

    Module Module1
        Function Area(ByVal radius As Double) As Double
            Return Math.PI * Math.Pow(radius, 2)
        End Function

        Sub Main()
            Dim a As Double = Area(4.0)
            Console.WriteLine(a)
            Console.Read()
        End Sub

    End Module

      Modified On Apr-10-2018 06:45:32 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.