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
How to replace junk code recorded by QTP with a mall function.
How will you get the exponent of the given number in vbscript?
What are the data types supported by vbscript?
What is the use of option explicit in vbscript?
What is the purpose of the err object in the vbscript language?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
Illustrate briefly about the different types of statement
1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
Both Static and dynamic arrays are handled by VB script. Is it true?
Which function is used in the vbscript language to convert the specified expression into a date type value?
What are the environments supported by vbscript language?
what is the differance between BYVAL,BYREF?
Explain sga memory structures?