Input = 124

output should be 124421
Please do not use any string functions/variables

Answers were Sorted based on User's Feedback



Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / manjunathareddy

Dim n
Dim s
Dim x
input=124
n=124
While int(n)>0
s=n mod 10
x=x&s
n=Int(n)/10
Wend
Msgbox input&x

Is This Answer Correct ?    6 Yes 0 No

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / eswar

'Numbers can be given at run time
For i=1 to 3
s =InputBox("Enter a number : ")
x = x&s
y = StrReverse(x)
Next
MsgBox x&y

Is This Answer Correct ?    2 Yes 2 No

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / bibhu

Hi Eswar,

The catch here is to not using any vb script functions

Thanks,
Bibhu

Is This Answer Correct ?    0 Yes 0 No

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / bherolal bhargav

i=cint(inputbox("Enter 3 digit No."))
i = i*1000+((i mod 100) mod 10)*100+((i mod 100) -(i mod
100) mod 10)+i\100
msgbox i

Is This Answer Correct ?    1 Yes 1 No

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / gyanesh ranjan rout

Function printnumber(numb)

x=numb
y=strreverse(x)

msgbox x&y
End Function

printnumber(124)

Is This Answer Correct ?    2 Yes 2 No

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / ramesh

Dim n
Dim s
Dim x
input=124
n=124
While int(n)>0
s=n mod 10
x=x&s
n=Int(n)/10
Wend
Msgbox input&x



Please explain this...........i am new to vb script

Is This Answer Correct ?    0 Yes 0 No

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / 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

Input = 124 output should be 124421 Please do not use any string functions/variables..

Answer / pankaja yathindrakumar

'Input = 124 output should be 124421 Please do not use any string functions/variables
str="124"
Set r=New RegExp
r.pattern="."
r.Global=True
Set c= r.Execute(str)
For each key in c
t=key&t
Next
Msgbox str&t

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

Here in my automation tool, i am retreiving some values and i need to store this values in the excel. How can i achieve this?. We are using VBA as scripting language. please let me know if you require any further inputs.

1 Answers  


How strcomp function works?

0 Answers  


wht must be the interview question on corinthian information technology solutions incorporated.

0 Answers   HP,


A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

0 Answers  


What is wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>

1 Answers  


What is vbscript procedures?

0 Answers  


how to check whether link is disabled in QTP??

0 Answers  


how to get date format from system locale..format means neither long nor shor... format from system locale. i need like your date is mm/dd/yyyy formate or mm-dd-yy or with time like that. how to get.

2 Answers  


Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder

0 Answers   IBM,


write a script to count no drives in file systems in qtp?

1 Answers   Mind Q Systems,


I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?

0 Answers  


Explain vbscript in detail?

0 Answers  


Categories