0
Is there any way to make random selection in c#?
2 Antworten
0
Hi, if you mean generating a random number, then yes. First, create an object of the Random class:
Random rand = new Random();
then to generate:
int number = rand.Next(1,10);
this will generate numbers from 1 to 10 (you can change the value in the brackets for a different range)
0
@Edi Lipovac thanks!