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

Which is the default Data types in VBScript?

5 Answers  


Explain about tristate constants?

0 Answers  


Explain about vb script?

0 Answers  


Which command is used for writing text on a page?

0 Answers  


Explain the scope of the variables using dim, public, and private keywords respectively.

0 Answers  






What is the event handling in vbscript?

0 Answers  


How to write Descriptive programming in .VBS file i wrote this code but it is giving error.. Dim qtApp set qtApp=createobject("QuickTest.Application") qtApp.Launch qtApp.Visible=True Set objIE = CreateObject("InternetExplorer.Application") objIE.visible = True objIE.Navigate "www.gmail.com" browser("title:=gmail").title("title:=gmail")

2 Answers  


Explain the constants in vbscript?

0 Answers  


How to write functions and sub in vb script?

0 Answers  


Which loop is used in case of arrays in the vbscript language?

0 Answers  


a function that takes an integer array as an argument and returns the largest value in the array. Use the function in a program

1 Answers  


What are class events?

0 Answers  


Categories