print the array values in ascending order?
Answers were Sorted based on User's Feedback
Answer / rajanikanth
Option Explicit
Dim a,i,b,j,temp
a=Array(30,70,10,60,90,20,50,80)
For i=0 To UBound(a)
For j=0 To UBound(a)
If StrComp(a(i),a(j),1)<0 Then
temp=a(i)
a(i)=a(j)
a(j)=temp
End If
Next
Next
For i=0 To UBound(a)
MsgBox a(i)
Next
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
What is the event handling in vbscript?
int a=4857 i need output as 7584.without using any inbuild function?
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.
What is difference between Active screen and movie screen recorder in QTP 9.2?
What are lbound and ubound in the vbscript language?
WHAT IS ENVIRONMENT VARIABLES?and where it is used in real time scenario?
what is extension of the file if its saved from recovery manger to some drive
write a Vb script to find a whther a selected drive exits.
why variable name should not exceed 255 characters?
Write a program to create a Dynamic array of size 5 elements and display all the elements.
Mention the environments where vbscript could be run?
There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?