Line 43: srand() should be called one and only once at the start of your program. You don't want to want to reinitialize the random number generator each time through the loop. Move to line 28.
Line 45: Your formula is defective. This will generate numbers from 10 - 110. That's not what you want according to your comment.
Line 47: Is going to generate 50 line feeds. Don't think you intended that.
Other than the above, your code looks like it should work.
Some comments on style that don't currently affect your program.
Line 25: Should be
const int size = 50;
Line 27: Your can use a const int to declare the size of your array.
1 2
|
const int size = 50;
int arr[size];
|
Line 39: You don't pass size to random_fill. size is hard coded inside random_fill. You should consider passing size as an argument so that random_fill can fill an array of any size.
Line 51, 60, 73: You pass size to these routines, but don't use it. These routines are hard coded to assume arr is 50. Since you're passing size as an argument, you should use it. Consider that if you want to change the size of the array at line 27, you have multiple places in your program that you would have to modify.
You say "I am still getting the same sorts of problems". Please be specific. I ran it after making the above changes and got the expected results.