The following code in Listing 1 returns a random number.
- // Generate a random number
- Random random = new Random();
- // Any random integer
- int num = random.Next();
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mahesh ChandRank #1 · 393.3K reputationPosted Sep 9, 2018, 9:14 AM EDT