generate a random number in c#
Random rnd = new Random();
int value = rnd.Next(min,max);
Console.Write(value);
generate a random number in c#
Random rnd = new Random();
int value = rnd.Next(min,max);
Console.Write(value);
how to pick a random item in c#
using System;
using System.Collections.Generic;
namespace Demo {
class Program {
static void Main(string[] args) {
var random = new Random();
var list = new List<string>{ "one","two","three","four"};
int index = random.Next(list.Count);
Console.WriteLine(list[index]);
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us