Generating random numbers

  • Thread starter Thread starter Visually Seen #
  • Start date Start date
V

Visually Seen #

Hi everybody,

A friend of mine and I want to develop a program that randomly
generates times tables for young kiddos.
So how do you generate random numbers (in C#)?

Seen Sharp
 
Hi,

have you got Visual Studio .Net? If so.. Help->Index->Random.

Otherwise, use class Random.
 
A friend of mine and I want to develop a program that randomly
generates times tables for young kiddos.
So how do you generate random numbers (in C#)?

Use the System.Random class. Note that you should create a single instance
and then use that repeatedly - don't create a new instance every time you
want a new random number, or you'll get the same number if you try to get a
random number several times in quick succession. (The initial seed is based
on the current time.)

Jon
 
Back
Top