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
Compare java script and vb script?
Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks
How will you convert a given number to long in vbscript?
How will you convert a string to upper case string using vbscript?
Description.Create
What are the different types of operators and their order of precedence?
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?
How will you get the natural logarithm of the given number in vbscript?
What is the scope of a constant declared using public?
How you can call vbscript functions?
write a program to display configuration of a local system with the help of vb script.
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.
i have a problem with this error(this error related edit and
delete button,when i click this button in datagrid..i will
get this error)"Invalid postback or callback argument.
Event validation is enabled using
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
What are the data types supported by vbscript?