{
    class Program
    {
        static void Main(string[] args)
        {
            Random randGen = new Random();

            int[] diceRolls = new int[11];

            for (int i = 1; i <= 7; i++)
            {
                int diceRoll = randGen.Next(1, 7) + randGen.Next(1, 7);

                diceRolls[diceRoll - 2] += 1;

                Console.Write(diceRoll + " ");
            }

            Console.WriteLine();
            Console.WriteLine("Here are the totals: ");

            for (int i = 2; i <= 12; i++)
            {
                Console.Write("Dice Roll: {0:}\t Rolled {1:} times", i, diceRolls[i - 2]); Console.WriteLine();


                foreach (int j in randomNum)
                {

                    Console.WriteLine("First Number:{0}", j);
                    {
                        int result;
                        Random rnd = new Random();

                        result = rnd.Next(1, 7);

                        return result;
                    }
                    int dice1;
                    int dice2;
                    int result;

                    Console.WriteLine("This program will ask the user to roll 2 dice after rolling the dice, the program will display the results of each roll. In addition, the sun of the roll should be displayed to the user. After displaying the dice and sum, the program should prompt the user asking if they’d like to roll again");
                    Console.WriteLine("press any key to continue");
                    Console.WriteLine("I want to generate the first random dice");
                    Console.Clear();

                    dice1 = randNum = new Random();

                    Console.WriteLine();
                    Console.WriteLine("--------");
                    Console.WriteLine("| "(dice1));
                    Console.WriteLine("|       |");
                    Console.WriteLine("--------");
                    Console.WriteLine("This program will ask the user to roll 2 dice after rolling the dice, the program will display the results of each roll. In addition, the sun of the roll should be displayed to the user. After displaying the dice and sum, the program should prompt the user asking if they’d like to roll again");
                    Console.WriteLine("I want to generate the first random dice");

                    dice2 = randNum = new Random();

                    Console.WriteLine();
                    Console.WriteLine("--------");
                    Console.WriteLine("| "(dice2));
                    Console.WriteLine("|       |");
                    Console.WriteLine("--------");

                    result = dice1 + dice2;
                    Console.WriteLine("The result is {0}.", result);

                    Console.Read();
                }
            }
        }
    }
}

You are creating a lot of random values (and way too many Random objects, you only need 1 per program). You need to rethink the logic of this program as you are doing a lot of stuff that doesn't need to be done (and line 37 effectively ends your program).

This article has been dead for over six months. Start a new discussion instead.