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

My Salary is 65000. How Much TDS I have to pay

0 Answers  


how to write vb script code for login gmail page by using notepad and how to run script in notepad

1 Answers  


Explain about filter expression?

0 Answers  


Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

0 Answers  


How are comments handled in the vbscript language?

0 Answers  






What variable can you use to share info across the whole application for one user?

2 Answers  


how to retrive the tooltip by using descriptive programming in qtp?

3 Answers   iGate,


How will you reverse a string in vbscript?

0 Answers  


How to create MSAcess table foriegn key

1 Answers  


how to operate webobjects in a webpage using getobject function and then using generic methods?

0 Answers  


When are redim statement and preserve keyword used in the vbscript language?

0 Answers  


write a Vb script to find a whther a selected drive exits.

1 Answers   CTS,


Categories