Answer:
using System;
class Program
{
public static void Main(string[] args)
{
Random rnd = new Random();
int tries = 0;
while (true)
{
tries++;
Console.Write("What do you think the total of two six-sided die will be? ");
int guess = int.Parse(Console.ReadLine());
int total = rnd.Next(1, 7) + rnd.Next(1, 7);
Console.Write($"The total was {total}. ");
if (total == guess)
{
Console.WriteLine($"Congratulations! It took you {tries} tries to guess successfully.");
break;
}
else
{
Console.WriteLine("Try again!");
}
}
}
}
Step-by-step explanation:
Worst case you could be guessing forever...