on line 3 you let cn= a random number from 0 to 5
on line 4 you let cn equal an array element from 0 to 3 that in that example is undefined, so if you run that code you get
0
0
0
0
where 0 is the contents of colors(0) to colors(3)
if this is part of a larger code example then you may have meant line 4 to read
colors(c)=cn
that will store the random colours in the array elements 0 to 3 rather than set cn to the contents of of the array (that negates the purpose of line 3, hope that helps.
Mentor.
PC1:XP, P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro, 6 way sound.
PC2: Linux, AMD 2ghz, 512mb ram, Nvidia GeForce4mx, 16 bit SB.
PC3: XP, laptop, intel 2.6ghz celeron, ATI 9000igp, 256mb