Generate and display 5 random integers from 50 to 100.
using System;
using System.Threading;
public class MainClass
{
public static void Main(){
Random rand = new Random();
byte[] bytes = new byte[4];
Console.WriteLine("Five random integers between 50 and 100:");
for (int ctr = 0; ctr <= 4; ctr++)
Console.Write("{0,8:N0}", rand.Next(50, 101));
}
}
Related examples in the same category