HOW TO CREATE FUNCTION IN VB.NET

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
VB.Net 
 583  View(s)
Ratings:
Rate this:
I want to use function in vb.net .please help me.
  1. aditya kumar Patel

    Post:254

    Points:1810
    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 Jan-27-2016 06:13:33 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!