jeudi 26 mars 2020

Generate Random Number and add it to the List C# with for loop

Below my Do method inside it I want to generate a random number and then use for loop to add that number. Anybody can help me to finish the loop?

 void IInventoryCommand.Do()
    {
        TargetList = new List<InventoryItem>();
        string[] randomNumber = { "First", "Second", "Third", "Fourth", "Fifth" };



        var rnd = new Random();
        number = rnd.Next(1, 6);
        int size = 5;

        for (int i = 0; i <= size; i++)
        {



        }
    }



Aucun commentaire:

Enregistrer un commentaire