VB One Dimensional Arrays

One Dimensional Array

using System;
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text

Namespace OneDimensionArray
    Friend Class Program
        Private Shared Sub Main(ByVal args As String())
            Dim a As Integer()
            Dim n, i As Integer
            Console.WriteLine("Enter n value")
            n = Integer.Parse(Console.ReadLine())
            a = New Integer(n - 1) {}
            Console.WriteLine("Enter {0} Values", n)

            For i = 0 To n - 1
                a(i) = Integer.Parse(Console.ReadLine())
            Next

            Console.WriteLine("The elements are")

            For i = 0 To n - 1
                Console.WriteLine(a(i))
            Next
        End Sub
    End Class
End Namespace



©Copyright 2016 All Rights Reserved LearnDotNetHome.com