how to find greatest of n numbers!

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to pass argument by reference to a function in vbscript?

540


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

530


What purpose does ‘on error resume next’ serves?

553


What is the difference between a dictionary and an array?

583


What is select case statement?

609






Mention what are the rules to name variable in vbscript?

540


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

2165


Which constant is used for print and display functions and works as same as pressing enter key?

532


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2510


Is vbscript a case-sensitive or case-insensitive?

755


Which date function is used in the vbscript language to find the difference between the 2 dates?

595


What is the use of the recordset object and which statement is used to create such an object?

531


If else for do while select in vb script?

647


What is Procedure or Subroutine in VB Script?

606


Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?

547