Hi, Anybody could tell me What is the 3rd Largest Number in
the series..Thanks in Advance..

Answers were Sorted based on User's Feedback



Hi, Anybody could tell me What is the 3rd Largest Number in the series..Thanks in Advance....

Answer / saket bharti

a=Array(-1,0,23,-12,98,-300)

Dim temp,i,j

For j=0 to UBound(a)-1

For i=0 to UBound(a)-1

If a(i)<a(i+1) then

temp=a(i+1)

a(i+1)=a(i)

a(i)=temp

End If

Next

Next

Msgbox a(2)

Is This Answer Correct ?    4 Yes 1 No

Hi, Anybody could tell me What is the 3rd Largest Number in the series..Thanks in Advance....

Answer / pushkar1206

a=array(1,22,3,40,12)
For i=0 to ubound(a)
For j=0 to ubound(a)
If a(i)>a(j) then
temp=a(i)
a(i)=a(j)
a(j)=temp
end if
Next
Next
print a(2)

Is This Answer Correct ?    1 Yes 0 No

Hi, Anybody could tell me What is the 3rd Largest Number in the series..Thanks in Advance....

Answer / anwar basha

dim temp,i,j
a=array(5,3,7,9,2,...)

for i=0 to ubound(a)-1
for j=i+1 to ubound(a)
if a(i)>a(j) then
temp=a(i)
a(i)=a(j)
a(j)=temp
end if
next
next
k=ubound(a)-2
msgbox a(k)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?

0 Answers   Microsoft,


How to select a value from a list box by using Selenium web-driver?

2 Answers   HCL,


Difference between dim,public and private variables in vb script?

0 Answers  


Explain a few date functions in vbscript

0 Answers  


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

0 Answers   IBM,






Mention what is vbscript procedures?

0 Answers  


hai all.iam chandu..please let me know how to test a link in QTP when it is changing at run time..and what property we should take while we r using descriptive programming for a link..

6 Answers  


how to find number of characters(letter a) in the sentence Rain Rain Go away

4 Answers  


Mention how you can call vbscript functions?

0 Answers  


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

0 Answers  


How can constants be declared in the vbscript language?

0 Answers  


How to write functional test cases for send button in gmail.

2 Answers   Arctern,


Categories