how to find greatest of n numbers!

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..

1812


What are the naming conventions while declaring a variable in the vbscript language?

621


What is the difference between VBScript and JavaScript?

2067


Which operator is used to concatenate the 2 values in the vbscript language?

560


Which object is used to work with the database in the vbscript language and what statement is used to create this object?

513






How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.

1744


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

536


What are the different types of loops available in the vbscript language?

536


What is the scope of a constant declared using public?

563


What is the purpose of the err object in the vbscript language?

630


Explain about operator precedence in vb script?

578


Which data type/types are supported by vbscript language and what are their specialties?

598


Can anyone send me a vb script function for verifying the functionality of active links on a web page

1602


Explain the constants in vbscript?

568


How are arrays declared in the vbscript language?

547