C# Console metot kullanarak dizi içindeki verileri toplama
{
public static int Add(int[] arr
{
int total = 0;
for (int i 0; i < .Length; ++i)
{
total += arr[i];
}
return total;
}
static void Main([] args)
{
int sizeArray = 0;
Console.Write("Input the size of Array : ")
sizeArray = Convert.ToInt32(Console.ReadLine());
int[] numbers int[sizeArray];
for (int i ; i < .Length; i)
{
Console.Write("Number {0} : ", + 1))
numbers[i] = Convert.ToInt32(Console.ReadLine()
}
Console.WriteLine()
Console.WriteLine("The Sum is :" Add(numbers))
//Console.WriteLine("www.csharp-console-examples.com");
Console.ReadKey()
}
}