iFocus.Life News News - Breaking News & Top Stories - Latest World, US & Local News,Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The iFocus.Life,

How to Reverse Numbers on Visual Basic

104 29
    • 1). Launch Microsoft Visual Basic Express, then click "New Project..." on the left pane of your screen and select "Console Application." Click "OK" to create a new console project.

    • 2). Type the following to create the integer array that will hold numbers 1 to 9:

      Dim numArray() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9}

      numArray.Reverse(numArray)

    • 3). Create the following "For...Loop" to display the numbers in reverse order through the console window:

      For xCntr = 0 To 8

      Console.Write(numArray(xCntr))

      Next

    • 4). Type the following to display a message box when the program is done:

      MsgBox("Array numbers reversed.")

    • 5). Press "F5" to execute the program and reverse the order of the array elements.

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time
You might also like on "Technology"

Leave A Reply

Your email address will not be published.