How to get greatest 5 numbers out of 6 numbers

Hi Koders,
I recently developed a doubt while coding an app.
I want to get five largest number out of six numbers and set those five greatest numbers in five variables…
Please tell me how to do that…
Thank You!

You can use listaddon or list util extension…

Get the numbers in list , if you want shuffle the list, sort it to descending order the list , so the greatest number will be arranged in order and you can use select list item list block to achieve what you want

How to arrange in descending order using list addons?

Use bubble sort method


Thanks and now how to take 2, 3, 4, 5 each to one variable?
Like global a=2
global b=3
global c=4
global d=5
Rember no to use “1”

You can use select list item list block

Set variable a to select list item list , index 1
Set variable b to …Index 2…

sorry didn’t understood… Can you please show it through a snap

1 Like

Thanks… I will try and inform whether it works

1 Like

sorting.aia (7.2 KB)

Using lists extension from @ Faraz_Firoz

Lists Extension