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

Difference between Do while loop and while wend loop

1 Answers  


write a vb script to display first 5 odd numbers from 1 to 100

4 Answers  


hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?

0 Answers  


how to write function to validate the number of characters entering into the text box?

2 Answers   TCS,


write a text script to display * as below ********** **** **** *** *** ** ** * * * * ** ** *** *** **** **** **********

1 Answers  






write a qtp script to count the number of minimized windows

1 Answers  


if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.

0 Answers  


Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..

10 Answers   CSC, Amazon,


how to increase the values in text box in a given text box increament by two values by clicking on button

0 Answers  


how do you make the variable declaration mandatory?what is the use of "option explicit"?

2 Answers  


what is diff between static and dynaic arrys?

0 Answers  


Write a Script for ATM in QTP

0 Answers  






Categories