C#C
C#3y ago
Lilac

C# Cyclic Numbers Array Check Help

I'm doing a homework for my Programming Fundamentals subject, which requires me to enter N numbers into array A, tell if array A is cyclic?
This is my progress so far:
c#
namespace _1_Dimensional_Array
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //formating
            Console.OutputEncoding = System.Text.Encoding.Unicode;

            //Request User Input             
            Console.Write("Enter the amount of elements of your array: "); //Determine the amount of numbers in this Array
            //Process unwanted inputs
            int how_much;
            while (true)
            {
                if (int.TryParse(Console.ReadLine(), out how_much))
                {
                    break;
                }
                else
                {
                    Console.Write("Enter the amount of elements of your array: ");
                }
            }

            // using Arrays
            int[] numbers = new int[how_much]; //create an array based on the user request

            // use loops

            for (int i = 0; i < numbers.Length; i++)
            {
                //Store all answers
                Console.Write($"Give me the {i} element of Array A: ");
                int element_number = Convert.ToInt32(Console.ReadLine());
            }



            Console.ReadKey();
        }
    }
}
Was this page helpful?