a function that takes an integer array as an argument and
returns the largest value in the array. Use the function in
a program
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 |
What is difference between Active screen and movie screen recorder in QTP 9.2?
If else for do while select in vb script?
How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script?
who will create the object?
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?
write a vb script to display factorial of a number using function
What is variant in vb script?
Mention characteristics of sub procedures?
How to use Text file (Notepad) as ur data source in QTP? Can u please provide some function code for it?
how to declare a variable in vbscript using vbscript
How will you get the largest subscript of an array in vbscript?
What is the difference between vb debugger and the script debugger?