How to sort only odd elements in array, evens stay where they are? Thanks. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to sort only odd elements in array, evens stay where they are? Thanks.

https://code.sololearn.com/cjCyOL8zy30A/?ref=app

27th Mar 2022, 6:07 PM
TeaserCode
1 Answer
+ 3
When this is true, your loop is infinite. if(arr[min] % 2 == 0) continue; And you are missing {} for inner if block.. Correct these, and find next.. hope you can.
27th Mar 2022, 7:10 PM
Jayakrishna 🇮🇳