BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Visual Programming (http://bzupages.com/237-visual-programming/)
-   -   Program to find the Maximum Number in an Array (By Sheraz) (http://bzupages.com/f237/program-find-maximum-number-array-sheraz-7177/)

.BZU. 15-12-2009 09:16 PM

Program to find the Maximum Number in an Array (By Sheraz)
 
Code:

  Module Module1
 
      Sub Main()
          Dim ar As Integer()
          Dim max As Integer
          ar = New Integer() {15, 8, 1, 6, 34, 7, 5, 342, 4, 7}
 
          max = ar(0)
 
          For i = 1 To ar.GetUpperBound(0)
              If ar(i) > max Then
                  max = ar(i)
              End If
          Next
 
          Console.Write("The Maximum value of the elements of array is: {0}", max)
          Console.ReadLine()
 
      End Sub
 
  End Module



All times are GMT +5. The time now is 07:07 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.