Module SortNumbers Sub Main() Dim number1 As Integer Dim number2 As Integer Dim number3 As Integer 'Dim number4 As Integer 'Dim number5 As Integer 'read in the first number Console.Write("Enter the first Number") number1 = Console.ReadLine() 'read in the second number Console.WriteLine("Enter the second Number") number2 = Console.ReadLine() 'read in the third number Console.WriteLine("Enter the third Number") number3 = Console.ReadLine() If number2 >= number1 Then 'check to see if number2 is larger than or equal to number1 Console.WriteLine(number2 & " " & number1) ' if it is than write that to the console Else : Console.WriteLine(number1 & " " & number2) ' or if number1 is bigger than print this message End If If number3 >= number2 Then 'If the third number is larger than the 2nd number Console.WriteLine(number3 & " " & number2 & " " & number1) ' this is where I am stuck. ElseIf number Then End If End Sub End Module
I considered making more variables like:
dim first dim second dim third dim fourth dim fifth
and then assigning the "number*" variable to the other first - fifth variable, but I thought I was getting a little more involved with it. I wish I had picked this up a 22 instead of 43 years old. I was hoping my old vb6 (from 1998) credits would still be good, but... Thanks for any small contribution. I know I'ts just one little thing, and I do remember doing something like this with array's in Java back in the day. But I don't program on a daily basis.