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


Please Help Members By Posting Answers For Below Questions

Dear All, I am geting below IE error whilie executing the QTP scripts in Batch mode "Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience." can any one suggest me how to resolve this issue . Thanks Balaji

1243


Which command is used for writing text on a page?

576


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

1787


What are string functions in vbscript?

656


How can you destroy an object in vbscript?

639






How to Import data from a file (file is on the desktop) to the data table

1556


What is the main difference between function and sub-procedure?

549


How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...

2903


How are arrays declared in the vbscript language?

541


How many types of procedures are available in the vbscript language?

532


What is vbscript?

600


What is the scope of a constant declared using public?

559


Explain How do you create a recordset object in vbscript?

566


Mention what is the technology used by vb script?

523


Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?

3034