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

write a vb script to display factorial of a number using function

1 Answers  


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

0 Answers  


what do you mean .ota mobile format

0 Answers  


What is vbscript language used for and which earlier language is it modeled upon?

0 Answers  


Which function is used in the vbscript language to convert the specified expression into a date type value?

0 Answers  






What is the use of the formatdatetime function in the vbscript language?

0 Answers  


what is event handling?

0 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,


What are the differences between Visual Basic, VBA and VBScript? When would it be appropriate to use one as opposed to another?

1 Answers   Infosys,


I want to import the sheet from the Excel to the Datatable using VB Script. I used the Syntax as 'Datatable.ImportSheet "Filename","SourceSheet","Destinat ionSheet" Ex: Datatable.ImportSheet "D:\Data1.xls","Sheet1","Global" Qtp producing run time error,How I can solve the problem

1 Answers  


How to generate 3 digit random number?

3 Answers   IBM, Virtusa,


Explain the scope of the variables using dim, public, and private keywords respectively.

0 Answers  


Categories