Read this article in your language IT | EN | DE | ES
public partial
class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object
sender, EventArgs e)
{
int toplam =
0;
for (byte i
= 0; i <= 100; i++)
{
toplam += i;
}
MessageBox.Show(toplam.ToString());
}
}
}
--------->
İkinçi Bir İşlemde / for dongusu listbox sayı ekleme
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object
sender, EventArgs e)
{
for (int
sayi1 = 1, sayi2 = 12; (sayi1 < 10 && sayi1 > 0); sayi1++, sayi2--)
{
listBox1.Items.Add(sayi1);
listBox2.Items.Add(sayi2);
}
}
i döngü değişkenine
genellikle başlangıçta 0 atanır. Dolayısıyla bir dizinin indekslenmesi ile
ilgili işlemlerde kolaylık sağlar.
for dongusu
listbox sayı ekleme
Saygılarımla Orhan Türk
c37b0bb2-3c63-445a-a240-32e458a7965b|0|.0
C#
c# for döngüsünün