using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } int sa; private void button1_Click(object sender, EventArgs e) { // 1-2-3-4-6-9-13... işlemini yapın double a=0, b=0, c=0, toplam=0, sayac=0; try { a = Convert.ToDouble(textBox1.Text); b = Convert.ToDouble(textBox2.Text); toplam = a + b; listBox1.Items.Add(a); listBox1.Items.Add(b); c = toplam ; listBox1.Items.Add(toplam); start: toplam = a + c; a = b; b = c; c = toplam; sayac++; listBox1.Items.Add(c); if (sayac < 6) { goto start; } } catch (Exception) { MessageBox.Show("ne yap*maya calısıyorsunuz ."); } } private void button2_Click(object sender, EventArgs e) { //int i=0; //for (;;) //{ // if (i<10) // { // listBox1.Items.Add(i); // } //} for (int i = 0; i < 10; i++) { listBox1.Items.Add(i); } int sayac=4; while (sayac<10) { listBox1.Items.Add(sayac); } int count = 0; do { count++; listBox1.Items.Add(count); } while (count<10); } private void Form1_Load(object sender, EventArgs e) { //diziler string[] myarray = new string[6]; myarray[0] = "hasabn"; myarray[1] = "hasabn"; myarray[2] = "hasabne"; Array.Resize(ref myarray, myarray.Length + 1); // otomatik artır //for (int i = 0; i < myarray.Length; i++) //{ // MessageBox.Show(myarray[i]); //} List<string> hasan = new List<string>(); // list örneği hasan.Add("hasan"); hasan.Add("asda"); hasan.Add("asdasda"); hasan.Add("asdasd"); //for (int i = 0; i < hasan.Count; i++) //{ // MessageBox.Show(hasan[i]); //} foreach (var item in hasan) { } } // } }