Start by looking at your random number generation code: does it generate numbers in the required range?
Simply put: no.
Your code generates numbers between 0 and 48 inclusive, not values between -10 and 10 inclusive. Rememebr, "%" is the modulus operator: it returns the remainder of a division, so x % 10 will always return values below 10, i.e. "0" to "9" inclusive.
Try changing it to something like:
eachRandomNumber = (rand() % 21) - 10;
The "21" is there so it generates values between 0 and 20 inclusive, then it subtracts 10 to offset the values into your range -10 to 10.
And then use the debugger to work out what else is going on.