Hi everybady,

i have faced few Qns in one of i attended interview, please help me out with these below Qns.
1. how to join values without using join function?
2. how to compare values without using String compare function?
3. input is Bangalore, but i need output like this below format, what is function to use and get this outcome
B
A
N
G
A
L
o
R
E
4. Input is "CapGemini" but uotput should be like this "inimeGpaC"
5. Input is
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Can someone let me know results of this Qns, please. Thanks.

Answers were Sorted based on User's Feedback



Hi everybady, i have faced few Qns in one of i attended interview, please help me out with these ..

Answer / cnu_thatavarthi

1. how to join values without using join function?

Ans:
Option Explicit
Dim strValue, arrValue,iCount

arrValue = Array("Srinivasulu","Thatavarthi")

For iCount = 0 To UBound(arrValue)

strValue =strValue&" "& arrValue(iCount)

Next

MsgBox strValue

'Actual Output:
---------------------------

---------------------------
Srinivasulu Thatavarthi
---------------------------
OK
---------------------------
2. how to compare values without using String compare function?
Ans:
Option Explicit
Dim strValue

strValue = "Thatavarthi"

If strValue = "Thatavarthi" Then
MsgBox "Both strings are same"
Else
MsgBox "Both strings are not same"
End If

'Expected out Put
---------------------------

---------------------------
Both strings are same
---------------------------
OK
---------------------------
3. input is Bangalore, but i need output like this below format, what is function to use and get this outcome
B
A
N
G
A
L
o
R
E?
Ans:
Option Explicit
Dim strValue,iCount, strNewValue

strValue = Ucase("Bangalore")

For iCount = 1 To Len(strValue)

strNewValue = strNewValue& vbNewLine& Mid(strValue,iCount,1)

Next
MsgBox strNewValue

'Expected Value:
---------------------------

---------------------------


B

A

N

G

A

L

O

R

E
---------------------------
OK
---------------------------
4. Input is "CapGemini" but uotput should be like this "inimeGpaC"
Option Explicit
Dim strValue,iCount, strNewValue

strValue = "CapGemini"

For iCount = Len(strValue) To 1 Step -1

strNewValue = strNewValue& Mid(strValue,iCount,1)

Next

strNewValue = Trim(strNewValue)
MsgBox strNewValue

'Expected value
---------------------------

---------------------------
inimeGpaC
---------------------------
OK
---------------------------
5. Input is
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Ans:

Option Explicit
Dim iCount,strValue,jcount,arrValue

For iCount = 1 To 5
For jcount = 1 To 5
If iCount = jcount then
strValue = strValue&jcount
Exit For
End IF
Next
arrValue = arrValue&vbNewline& strValue
Next

MsgBox arrValue
'Expected Output
---------------------------

---------------------------


1

12

123

1234

12345
---------------------------
OK
---------------------------

Is This Answer Correct ?    0 Yes 0 No

Hi everybady, i have faced few Qns in one of i attended interview, please help me out with these ..

Answer / testengineer

4. Input is "CapGemini" but uotput should be like this "inimeGpaC"

Ans: StrReverse("CapGemini")

3. input is Bangalore, but i need output like this below format, what is function to use and get this outcome
B
A
N
G
A
L
o
R
E

Ans:
string1= "Banglore"
string2=ucase(string1)
strlength=len(string2)
For i = 1 To strlength
val=Mid(string2,i,1)&vbNewline
print val

Next

5 Ans:

For i = 1 To 5
For j = 1 To i
print j
Next
Next

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More VB Script Interview Questions

What is event handling in vbscript?

0 Answers  


what is the use of Data base check point ?

3 Answers  


What methods are used to create text files and open text files in the vbscript language?

0 Answers  


What is the output of a + b in vbscript if a = 5 and b = 10?

0 Answers  


What is difference between vbscript and vba?

0 Answers  






can anyone tell me the procedure of interview held in applabs

0 Answers  


What is Querystring collection?

0 Answers  


Explain the adodb.stream class?

0 Answers  


wat is com(common object model)object for mozilla firefox??? if any knows the exact answer....plz rply me

2 Answers  


Mention characteristics of sub procedures?

0 Answers  


What is the use of the formatdatetime function in the vbscript language?

0 Answers  


can u test the application without add-in?

1 Answers  


Categories