Answers for "php workspace"

PHP
0

php workspace

<?php
  $x[0]=22 ; $x[1]=32;$x[2]=35;$x[3]=40;
for($i=0;$i<=count($x)-1;$i++)
echo $x[$i];
echo "<br>" .count($x);
echo "<br> thesumof array valueis = $r <br> " ;
function findsum($a)
{
 $sum=0
for($i=0 ;$i<count($a);$i++)
$sum+=$a[$i];
return $sum;
}
$r=findsum($x);
$l=largest($x);
echo"<br>" the largest value is = $l<br> " ; 
function largest($q)
{
$l=$q[0];
for($i=1;$i<count($q);$i++)
if($q[$i]>$l)$l=$q[$i];
return $l ; 
} 
?>
Posted by: Guest on July-01-2020

Browse Popular Code Answers by Language