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

Can anybody code this problem for me in VB script - Create an array of 4 elements, increase its size to 7 elements and then find out which of the elements are prime (use functions)

2 Answers  


Could Anybody tell me the VBscript for REVERSE an Integer int reverse(int num) Ex:246 to 642

7 Answers   Amazon,


Which command is used for writing text on a page?

0 Answers  


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

0 Answers   CSC,


What is the difference between Javascript & Vbscript?

2 Answers  






Hi, I need to accept user inputs for login at runtime.I know i can use Inputbox but how to proceed further that i dont know. Thanks in advance

2 Answers  


Does VB/Win make standalone .EXE files?

0 Answers  


Mention what is variant in vbscript?

0 Answers  


what is the function to display current date?

4 Answers  


write a program to display configuration of a local system with the help of vb script.

0 Answers  


Difference between Function and Sub routine?

0 Answers   Polaris,


compare the string without using stringcomp function?

1 Answers   CSS Corp,


Categories