Hi I'm trying to generate two random numbers using the ramdom class. However, I always get the same random number for both variables. Is there a way I can get two distinct numbers? Thanks.
calnastic
0
Newbie Poster
Recommended Answers
Jump to PostYou need to use the .Next() method.
Random rdm = new Random(); Console.WriteLine( rdm.Next( 0 , 100 ) ); Console.WriteLine( rdm.Next( 0 , 100 ) );
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.