TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jonathan Crispe
NA
46
48.3k
2d array with random number
Nov 8 2011 9:24 PM
i had programming exam this morning...i failed...
still i wanna know how to do this.
instruction:
create 2d array [5,5] with random number from 0 to 9... and calculate the column...
private void button1_Click(object sender, EventArgs e)
{
int[,] iArray = new int[5, 5];
Random rnumber = new Random();
int inum = rnumber.Next(0, 9);
for (int x = 0; x < iArray.GetLength(0); x++)
{
for (int y = 0; y < iArray.GetLength(1); y++)
{
iArray[x, y] = inum;
label1.Text = inum.ToString();
}
}
}
my code showing only 1 random number. instead of 5 by 5 random number...
Reply
Answers (
6
)
Jagged array
displaying and saving values in a third party application from my application in asp.net and c#