answersLogoWhite

0

AllQ&AStudy Guides
Best answer

$arr=array(2,5,4,6,7,8,1);

for($i=0;$i<count($arr);$i++)

{

for($j=$i;$j<count($arr);$j++)

{

if($arr[$i] > $arr[$j])

{

$temp=$arr[$i];

$arr[$i]=$arr[$j];

$arr[$j]=$temp;

}

}

}

This answer is:
Related answers

$arr=array(2,5,4,6,7,8,1);

for($i=0;$i<count($arr);$i++)

{

for($j=$i;$j<count($arr);$j++)

{

if($arr[$i] > $arr[$j])

{

$temp=$arr[$i];

$arr[$i]=$arr[$j];

$arr[$j]=$temp;

}

}

}

View page

No arr refers to address of array &arr refers address of address of array but compiler treats arr and & arr, so even you place arr and & arr no error only warnings will be displayed.

View page

Yes, 'ARR' and 'ARR' are the same for char20. Whatever it means.

View page

There is no such person as Trad Long.

View page

for example:

int arr[3];

arr[0] = 1; /* ok */
arr[1] = 2; /* ok */
arr[2] = 0; /* ok */
arr[3] = -1; /* wrong */
arr[-1] = -3; /* wrong */

View page
Featured study guide
📓
See all Study Guides
✍️
Create a Study Guide
Search results