You need to write
rnumber[i]
instead of
i
. Please see the very first comment by richcb and my comment below.
Also, you forgot to use
num
. You need to move your first line too lines lower, when
num
is already defined and replace your
immediate constants of 10 by
num
in both array declaration and the loop (if it was your attention, otherwise it should be any explicitly defined constant). Hard-coding is really bad thing. Imagine you need to replace 10 by 13. Can you see how error-prone will it be?
Last statement is not very good, it's better to use
System.Console.ReadKey(true);
please see:
http://msdn.microsoft.com/en-us/library/x3h8xffw.aspx[
^].
The question itself wasn't correct. "What's wrong" makes no sense unless you explain what you wanted to achieve.
—SA