print the array values in ascending order?
Answer Posted / cnu_thatavarthi
arr = Array(4, 6, 2, 7, 3, 5, 1, 8, 10, 22, 33, 15, 11, 8)
For i = LBound(arr) to UBound(arr)
For j = LBound(arr) to UBound(arr) - 1
If arr(j) > arr(j + 1) Then
TempValue = arr(j + 1)
arr(j + 1) = arr(j)
arr(j) = TempValue
End If
Next
Next
s = ""
For i = LBound(arr) To UBound(arr)
s = s & arr(i) & ","
Next
Msgbox s
'Expected output
---------------------------
---------------------------
1,2,3,4,5,6,7,8,8,10,11,15,22,33,
---------------------------
OK
---------------------------
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain about the extension .hta?
what is event handling?
What are the uses of vb script?
how to automatically update the sql server2005 database records when insert in vb6?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
If else for do while select in vb script?
Mention when to use function procedures and what are its characteristics?
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
What are the rules to name variable in vbscript?
What is the difference between javascript and vbscript?
I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..
write a program to display configuration of a local system with the help of vb script.
Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?
How to get the length of the string by making use of the string function?
What is the difference between vb debugger and the script debugger?