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 are the different types of loops available in the vbscript language?
What is difference between vbscript and vba?
What is the difference between vb debugger and the script debugger?
wht must be the interview question on corinthian information technology solutions incorporated.
Why is it recommended to close the database connection every time after the work is completed?
Explain vbscript in detail?
What are the naming conventions while declaring a variable in the vbscript language?
hi i am trying for testing job for 3+ experience(fake) can u suggest me what type of projects i can keep in my resume and how much of knoeledge i should have abt that project.thnks in advance.urgt plz
Which keyword is used to declare a variable in the vbscript language?
1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.
What is sql loader? Explain the files used by sql loader to load file?
What are the advantages of vbscript?
How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.
How to make sure that items in a wintree are sorted al?
Mention what is the technology used by vb script?