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
Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.
What is difference between vbscript and vba?
Which in-built function related to an array joins substrings into one string in the vbscript language?
Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?
How to capture a runtime error in vbscript?
Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository
how to write validation function for date in vb script
regular expression that will recognize a browser as long as its name property starts with mybrowser
What is the extension of the vbscript file?
Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com
what types of bugs will we find out in banking projects for automation testing?
What is the difference between function and procedure?
What is the event handling in vbscript?
Which operator can be used to change the value of the operand or change the state of the condition?
Mention what is the main difference between function and sub-procedure?