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 is event handling?
how to automatically update the sql server2005 database records when insert in vb6?
What are the different types of operators and their order of precedence?
wht must be the interview question on corinthian information technology solutions incorporated.
How to replace junk code recorded by QTP with a mall function.
Which operator can be used to change the value of the operand or change the state of the condition?
If else for do while select in vb script?
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
What is the use of the recordset object and which statement is used to create such an object?
PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com
Explain some uses of vb script?
Mention what is variant in vbscript?
How to throw an error in vbscript?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...