Prime b

Prime b

  • NA
  • 810
  • 345.9k

Stuck again on methods

Jan 17 2012 7:02 PM
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)