using System;Random rand = new Random();var random = rand.Next(3);//random is 0, 1 or 2 Console.WriteLine(random);