generate a random number code example

Example 1: random number generator

Random RNG = new Random();
int randomNumber = RNG.Next(x, y) //x is the minimum number, and y is the maximum number

Example 2: rng

Random rng = new Random()
rng.Next(min,max)

Example 3: Generating a random number

Random rnd = new Random();
int randomNumberTo10 = rnd.nextInt(10); // 0 - 9-ig generálhat számokat, 10-et sosem generál

Example 4: how to generate random number

<?php 
//  how to generate random number in php 
//The rand() function generates a random integer.

echo rand(111111,999999); 

?>