public static void Main()
var totalIterations = 10000;
while (iterationsSoFar < totalIterations)
var numRolls = GetRandRollsNeededToBeAboveOne();
Console.WriteLine($"{numRolls} rolls.\tAverage is now {(float)totalRolls / iterationsSoFar}");
public static int GetRandRollsNeededToBeAboveOne()
var rand = new System.Random();
total += rand.NextDouble();