SyntaxFix
Write A Post
Hire A Developer
Questions
int a = srand(time(NULL)) arr[i] = a;
Should be
arr[i] = rand();
And put srand(time(NULL)) somewhere at the very beginning of your program.
srand(time(NULL))