Program to enter value into the array and print


Module Module1

Sub Main()

'program to input value into array and print it out

Dim arr(5) As Integer 'assigning array with integer in it
Dim index As Integer 'assigning the counter to be used in the loop

Console.WriteLine("Enter the values into the array")
For index = 1 To 5
arr(index) = Console.ReadLine
Next

Console.WriteLine("The elements inside the aaray are: ")
For index = 1 To 5
Console.Write(arr(index) & " ")
Next
Console.ReadKey() ' this line of the code holds the window to see the output
End Sub

End Module

Comments

Popular posts from this blog

Program to extract vowel from the input string

Check whether the input number is arm-strong or not

Print the factorial value of an input number