Beispiel #1
0
        private static void DecimalArrayProcessing()
        {
            ArrayLength();
            decimal[] decimalArr = new decimal[length];
            for (int i = 0; i < decimalArr.Length; i++)
            {
                decimalArr[i] = Convert.ToDecimal(Math.Round(SingleRandom.Next(-100000, 100000) + SingleRandom.NextDouble(), 7));
            }

            ConsolePrintArray(decimalArr);
            decimal decimalSum = decimalArr.ArraySum();

            Console.WriteLine($"Sum of elements in array: {decimalSum.ToString()}");
        }