Declare arr[5]
Set arr(=4, 5, 7, 2, 5)
fon 0 to 5
for j = to 4
Declare t
If(arr[j] < arr[j+1])
By Ruby

Declare arr[5]
Set arr(=4, 5, 7, 2, 5)
fon 0 to 5
for j = to 4
Declare t
If(arr[j] < arr[j+1])
t = arr[j]
arr[i] = arr[j+1]
arr[j+1] = t.
End if
End for​

About the author
Ruby

1 thought on “<br />Declare arr[5]<br />Set arr(=4, 5, 7, 2, 5)<br />fon 0 to 5<br />for j = to 4<br />Declare t<br />If(arr[j] < arr[j+1])<b”

Leave a Comment