i use
Random rnd = new Random();
x=rnd.Next(10);
but every time i get the same number.
how to fix it and get different numbers? Tell me easy method.
thanks. sorry for bad english.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make sure you use the constructor only once. You can add a seed.
Then you can make calls to as you actually did it.
But make sure you don’t have the constructor and the call to the Next() method inside a loop or something similar…