Select a random number between two numbers using C#


0

0 0
I want to select a random number between two numbers n and m using C#. How can I do this? Is there an inbuilt method that can help me get a random number.
Ravinder Singh
Posted on : Tue, May 24, 2016
Views : 214

Ask Question

If you want to ask question you must LogIn or SignUp
Login SignUp

Related Questions

Answers (1)


0

The Random class is used to create random numbers.

 

Showing in code below:

Random random = new Random();
int firstNumber = random.Next(1, 3);



 

1 is initial number and 3 is range. It will generate random number which will be less then 3.

Sarabjeet Singh
Wed, Jan 24, 2018
Loading...

Edit Answer

Submit
This answer will permanently deleted. Do you really want to delete this Answer ?
To Add your Answer Please
LogIn | SignUp

Quick Links

E-Magazines

@

Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..

Ok

Login to Open ESchool OR Create your account    Login   SignUp