The reason for the zeroes is that you keep overflowing the end of the arrays. You aren't guaranteed anything about random numbers, that's the point, and you aren't guaranteed to get just as many numbers from 1 to 16 as you are in any other range, which your code assumes to be the case. So one or more of b,i,n,g,o are exceeding 4 and writing somewhere else in memory, which is a UB bug. This also means ctr reaches 24 before all numbers are filled in, hence the zeroes.
So what you need to do as I already said is to add a check for each of b,i,n,g,o and do nothing if it's greater than 4, e.g.
if (xx>=1 && xx<16 && b<5)
With this change the code ran fine in Visual Studio 2008 and I got no duplicates or zeroes.