I'm curious to know how you would convert the following into a while loop. I know it doesn't make the most sense in this situation but I am working out of a student workbook and would like to see another example. Thanks in advance, any help is much appreciated.
int sides = 0;
int number = 0;
int total = 0;
Random random = new Random();
Console.WriteLine("Choose the number of sides.");
sides = int.Parse(Console.ReadLine());
Console.WriteLine("Choose number of dice.");
number = int.Parse(Console.ReadLine());
for (int i = 0; i < number; i++)
{
int die = random.Next(1, sides);
Console.WriteLine("You Rolled {0}", die.ToString());d
total += die;
}
Console.WriteLine("Your total is {0}", total);
Console.ReadLine();