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
Maha
NA
0
323.9k
Audience and Seat#
Oct 10 2013 2:53 PM
Only one seat should be allocated to one audience randomly. More than one audience can't have same seat or vice versa. How can this program be completed with these conditions?
using System;
class Program
{
public static void Main()
{
int seats = 10;
int audience = 10;
int[] audArray = new int[audience];
Random r = new Random();
Console.WriteLine("{0 ,4} {1, 5}", "Audience", "Seat#");
for (int i = 1; i < audience; i++)
{
int x = r.Next(1, seats);
audArray[i] = i;
Console.WriteLine("{0, 3} {1, 6}", audArray[i], x);
}
Console.Read();
}
}
Reply
Answers (
7
)
Creating a Windows Application to view Images
Set function keys to button click