Imports System
Public Class MainClass
Shared Sub Main(ByVal args As String())
Dim i As Integer ' counter
Console.WriteLine("Number" & vbTab & "Square" & vbCrLf)
' square numbers from 1 to 10
For i = 1 To 10
Console.WriteLine(i & vbTab & Square(i))
Next
End Sub
Shared Function Square(ByVal y As Integer) As Integer
Return y ^ 2
End Function
End Class
|