[Solved] rand() and sorting do not work as expected in C from thenewboston tutorial 41 [closed]
[ad_1] It’s just a simple mistake where you must use the variable i instead of a constant. If I change your code and use the variable instead of the constant, then the code works. #include <stdio.h> #include <stdlib.h> int main() { int i, temp, swapped; int howMany = 10; int goals[howMany]; for (i=0; i<howMany; i++) … Read more