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 ?    8 Yes 2 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 ?    8 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

what is the standards used for writing the script in QTP

0 Answers  


how to organize files in object repository of qtp

1 Answers  


how to display all the links in one page using vb script in qtp.

1 Answers   DST Global Solutions,


Write a program using Java Script / VBscipt that checks if two matrices have identical values in all the elements

1 Answers   Ignou,


Hi Friends, I am facing some issues with If,else condition,i.e. i am working on some web page for ex:gmail page.now if i want to check if username is incorrect or already exist,i want to display error message in my test report,for this i am using a simple code first,i.e. If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "Shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If But still i am getting a syntax error If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If I don't feel any thing wrong in this syntax but i don't understand why it shows such error,i am confused what went wrong,please help me out & do the favor,thanks a lot....

1 Answers  






VBscript for QTP,best tutorial?

2 Answers   Wipro,


Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?

0 Answers   Tech Mahindra,


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

0 Answers  


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

0 Answers  


How will you get the octal value of the given number in vbscript?

0 Answers  


What is the differene between QTP 8.2 and QTP 9.0 and QTP 9.1,Pls give me answer ASAP.

3 Answers   Accenture,


write a vb script to generate 3*3 matrix

2 Answers  


Categories