Monday, 4 February 2019

Generate Random Numbers with Random




using System;
class RandDice
{
    static void Main()
    {
        Random ran = new Random();
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.Write(ran.Next(1, 7) + " ");
        Console.ReadKey();
    }
}

No comments:

Post a Comment