Azra
Bronze Üye
-
- Katılım
- 11 Mart 2014
-
- Mesajlar
- 3.834
-
- Tepkime puanı
- 13
-
- ForumSAL Yaşı:
- 12 yıl 7 ay
- Kıdem:
- Forumun Eskisi
-
- Yaş
- 35
Kod:
using System;
class DiziTopla
{
public static void Main(string[] args)
{
int[] dizi = { 5,6,7,8 };
Console.WriteLine(topla(dizi));
}
public static int topla(int[] dizi)
{
int toplam = 0;
for(int i=0; i<dizi.Length; ++i)
toplam+=dizi[i];
return toplam;
}
}