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
Christopher
NA
7
0
Multiple Random Numbers
Jun 19 2010 1:23 PM
Hi there,
I'm a noob, so please dumb it down for me.
I'm trying to output multiple random numbers.
Why doesn't the code below work?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Lab5Ex_2
{
class Program
{
static void Main(string[] args)
{
for (int z = 0; z < 36; z++)
{
Random RandomNumber = new Random();
int answer = RandomNumber.Next(1, 6);
int answer2 = RandomNumber.Next(1, 6);
int total = answer + answer2;
Console.WriteLine(answer + " and " + answer2);
Console.WriteLine("The total is " + total);
}
Console.Read();
}
}
}
Thanks for taking a look,
Chris
Reply
Answers (
1
)
Flash (swf) problem
How to convert numbers to equivalent words?