Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Task_3._4._2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] numbers = { 1, 5, 6, 8, 15, 43 };
- Console.WriteLine(SumNumbers(numbers));
- Console.ReadLine();
- }
- public static int SumNumbers(int[] numbers)
- {
- int sum = 0;
- for(int i = 0; i < numbers.Length; i++)
- {
- sum += numbers[i];
- }
- return sum;
- }
- }
- }
Add Comment
Please, Sign In to add comment