Random Number - CSharp System

CSharp examples for System:Random

Description

Random Number

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from w ww. j av a  2 s  . c o m*/

public class Main{
        public static int RandomNumber(int minValue, int maxValue)
        {
            var random = new Random();

            return random.Next(minValue, maxValue);
        }
        public static int RandomNumber(int maxValue)
        {
            return RandomNumber(0, maxValue);
        }
}

Related Tutorials