0% found this document useful (0 votes)
26 views

Module Module1

This Visual Basic code defines a module and subroutine to read in 5 integer values from the user, store them in an array, find the minimum value in the array, and output the minimum number. It takes user input to populate an array, calls a min function to determine the smallest value in the array, and prints out the minimum number found.

Uploaded by

kiruthika
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Module Module1

This Visual Basic code defines a module and subroutine to read in 5 integer values from the user, store them in an array, find the minimum value in the array, and output the minimum number. It takes user input to populate an array, calls a min function to determine the smallest value in the array, and prints out the minimum number found.

Uploaded by

kiruthika
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Module Module1

Sub Main()
Dim a(5), i, small As Integer
For i = 1 To 5
Console.WriteLine("enter number:")
a(i) = Integer.Parse(Console.ReadLine())
Next
small = min(a, 5)
Console.WriteLine("minimum no is{0}", small)
End Sub

Private Function min(ByVal x() As Integer, ByVal n As Integer) As Integer


Dim m, i As Integer
m = x(1)
For i = 2 To n
If m > x(i) Then
m = x(i)
End If
End Function

End Module

You might also like