2
Answers

Stuck again on methods

Prime b

Prime b

12y
1.1k
1
Create a method named Sum() that accepts any number of
integer parameters and displays their sum. Write a Main()
method that demonstrates the Sum() method works correctly
when passed one, three, or fi ve integers, or an array of ten
integers.


Um, this is what I have done................Nothing really

        static void Main(string[] args)
        {

        }
        static void Sum(out int[] numbers)
        {
           
            Console.WriteLine("Please enter as many numbers as you want to see the sum of those numbers: ");
            numbers = Convert.ToInt32(Console.ReadLine());

            for (int index = 0; index < numbers.Length; ++index)
            {
               
            }
        }

Answers (2)