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



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

Answer / abd al-ala camara

<?php
// define function largest()
function largest($numbers) {

foreach ($numbers as $temp) {

$largestNumber = max($numbers);

}

return $largestNumber;

} // end function

$numbers = array(3, 45, 2, 56, 7, 9, 78, 23, 63);
echo largest($numbers); // if you want you can echo or just
use it another function or programe
?>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me

0 Answers  


write a vb script to find the size of d drive?

3 Answers  


Could Anybody tell me the Script for REVERSE an Interger int reverse(int num) Ex:246 to 642.. Thanks in Advance.

3 Answers   Amazon,


There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?

1 Answers   eMids,


Explain about constants in vb script?

0 Answers  


Can automation testing find ssame no. of bugs what we can find by manual testing?

0 Answers  


Which function is used to perform string comparison?

0 Answers  


int a=4857 i need output as 7584.without using any inbuild function?

6 Answers   Aspire,


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

0 Answers  


i have developed the below QTP script to count the no of items available in the web list "Select a product" in www.bankrate.com and also want to print what are the items??? can any one help me to rectify the below script??? SystemUtil.Run "iexplore.exe","www.bankrate.com" a=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetTOProperty("items count") msgbox a Dim List() ReDim List(a-1) For i = 1 To a List(i-1)=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page ("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetItem(i) Print List(i-1) Next

1 Answers  


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

0 Answers  


Explain sga memory structures?

0 Answers  


Categories