how to find greatest of n numbers!

Answers were Sorted based on User's Feedback



how to find greatest of n numbers!..

Answer / mudaseer

dim varr(4),vhigh
for i=0 to 4 step 1
varr(i)=cint(inputbox("enter the value"))
next
vhigh=varr(0)
for i=1 to 4 step 1
if varr(i)>vhigh then
vhigh=varr(i)
end if
next
msgbox vhigh

Is This Answer Correct ?    7 Yes 1 No

how to find greatest of n numbers!..

Answer / raju

dim i, lar, j, a()
i=Cint(Inputbox("Enter the value how many value to be enter"))
for j=1 to i
ReDim a(i)
a(j)=inputbox("enter the numbers")
Next
lar=a(0)
for j=1 to i
If a(j)>lar Then
lar=a(j)
End IF
Next
msgbox "Largest Number is" & lar

Is This Answer Correct ?    6 Yes 4 No

how to find greatest of n numbers!..

Answer / venkatesh

option explicit
dim myarray,max,i
myarray = array( 34,23,45,67,12 )
max=myarray(0)
for i=0 to ubound(myarray)
if max < myarray(i) then
max=myarray(i)
end if
next
msgbox "max number is : "&max

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More VB Script Interview Questions

Why is error handling required?

0 Answers  


What are the properties of regexp object?

0 Answers  


Which in-built function is used to format the number in the vbscript language?

0 Answers  


Which operator is used to perform the comparison among 2 operands in the vbscript language?

0 Answers  


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

0 Answers  






am giving to one number u can set into that in date format.u can use any methods

1 Answers   HP,


accept a string & display whether a is present or not

1 Answers  


What is the extension of the vbscript file?

0 Answers  


what is test scenario?

1 Answers  


How will you release the memory acquired by an array variable in vbscript?

0 Answers  


print the array values in ascending order?

2 Answers   CSS Corp,


we executed QTP scripts in one browser(i.e IN)same scripts is working on another browsers or not (i.e mean netscap,m azol..like )

6 Answers   Accenture,


Categories