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
what do you mean .ota mobile format
How to throw an error in vbscript?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
Mention what is vbscript procedures?
Mention what is byref and byval parameters in vbscript?
Explain about tristate constants in vbscript?
Explain the filter expression?
Which object is used to work with the database in the vbscript language and what statement is used to create this object?
How will you get the octal value of the given number in vbscript?
Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).
how to set one column as primary key in QTP and fetch values accordingly
What are the special sub-types in vbscript?
Both Static and dynamic arrays are handled by VB script. Is it true?
What are the properties of regexp object?
what is the features of visual basic?