Input = 124
output should be 124421
Please do not use any string functions/variables
Answer Posted / anil
input="421"
Dim arr(3)
arr(0)="4"
arr(1)="1"
arr(2)="2"
Set arrlist=CreateObject("system.collections.Arraylist")
For i=0 To UBound(arr)-1
arrlist.add arr(i)
Next
arrlist.sort
For i=0 To UBound(arr)-1
c= arrlist.item(i)
temp=temp&c
next
MsgBox temp&input
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How will you convert a string to lower case string using vbscript?
What is the purpose of on error resume next statement?
Sub link() Dim k As Integer Dim rand As Integer Dim URL As String Dim foldernum As Integer Dim folderstring As String Dim filenum As Integer Dim filestring As String k = 1 'for AC Numbers For i = 11 To 40 foldernum = 0 foldernum = 1000 + i folderstring = CStr(foldernum) folderstring = Mid(folderstring, 2, 3) folder = "ac" & folderstring 'folderstring = Sheets(2).Cells(i, 1) ' for Number of Random files For j = 1 To 10 rand = Int(Rnd * (200 - 1) + 1) filenum = 0 filenum = 1000 + rand filestring = CStr(filenum) filestring = Mid(filestring, 2, 3) 'URL = "http://ceobihar.nic.in/PSCDROM/ac" & folderstring & "/i" & folderstring & "0" & filestring & ".pdf" URL = "http://www.elections.tn.gov.in/pdfs/dt1/" & folder & "/" & folder & filestring & ".pdf" ' URL =http://www.wb.nic.in/wbeco/EROLLS/PDF/English/A001/a0010105 .pdf Cells(k, 1) = folderstring Cells(k, 2) = folder Cells(k, 3) = filestring Cells(k, 3) = URL k = k + 1 Next j Next i End Sub plz define it
How to assign a numeric value to a variable?
how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me
How will you get a string with the specified character the specified number of times in vbscript?
How will you get the largest subscript of an array in vbscript?
What are the advantages of vbscript?
Which object provide information about a single runtime error in a vbscript?
How should i Create Email invite with server-side Coding?
what types of bugs will we find out in banking projects for automation testing?
Explain about the asc function?
what is resorceallocation
How will you reverse a string in vbscript?
Explain some uses of vb script?