I'm new in c, what is wrong here? I can't sort numbers... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I'm new in c, what is wrong here? I can't sort numbers...

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

25th Mar 2022, 1:04 PM
Vkd
Vkd - avatar
4 Answers
+ 2
Logic is correct but you need to know how the functions and prototypes are created in c. Then calling function by pass by value and pass by reference.. First you declared functions inside main. But you need to add it out side main as functions are independent separate block of code to perform a task. Then your swap function is working by pass by value so any changes in function don't reflect back in array.. Instead pass arr, index values to swap then in function swap array values by indexes. . but you need loops, inner loop need n times iterations Try again and reply.. Hope it helps..
25th Mar 2022, 1:43 PM
Jayakrishna 🇮🇳
+ 1
Thank you. I'm still trying to get a hold of functions. So going back to fundamentals again I guess...
25th Mar 2022, 6:36 PM
Vkd
Vkd - avatar
0
Try again.. You can reply if , still you have trouble with code then. You're welcome,..
26th Mar 2022, 1:24 PM
Jayakrishna 🇮🇳
0
Jayakrishna🇮🇳 please help me again😥😭
22nd May 2022, 10:13 AM
Vkd
Vkd - avatar