• 01-06-2020, 13:41:51
    #1
    Arkadaşlar merhaba. Görsel programlama ile ilgili aşağıdaki örnek için yardımcı olabilecek varmıdır. Ücret dahilinde olabilir...
  • 01-06-2020, 13:43:50
    #2
    tek çift için x%2=0 formulü kullanılmıyor mu hocam 0 0 ise çift 1 ise tek
  • 01-06-2020, 13:57:17
    #3
    ynncl adlı üyeden alıntı: mesajı görüntüle
    tek çift için x%2=0 formulü kullanılmıyor mu hocam 0 0 ise çift 1 ise tek
    Hocam şuan tam hakim değil arkadaş konuya. Bende müsait deilim. Yardımcı olucak varsa ücreti dahilinde yaptırabilir
  • 01-06-2020, 13:59:00
    #4
    int a = 0, b = 0, x = 0, y = 0, c = 0;
    private void Button1_Click(object sender, EventArgs e)
    {
    a = Convert.ToInt32(textBox1.Text);
    b = Convert.ToInt32(textBox2.Text);
    x = Convert.ToInt32(textBox3.Text);
    if(x%2==0)
    {
    c = 2 * a + b;

    }
    else
    {
    c = a + 3 * b;
    }
    MessageBox.Show(c.ToString());

    }
  • 01-06-2020, 14:44:52
    #5
    e2ral adlı üyeden alıntı: mesajı görüntüle
    int a = 0, b = 0, x = 0, y = 0, c = 0;
    private void Button1_Click(object sender, EventArgs e)
    {
    a = Convert.ToInt32(textBox1.Text);
    b = Convert.ToInt32(textBox2.Text);
    x = Convert.ToInt32(textBox3.Text);
    if(x%2==0)
    {
    c = 2 * a + b;

    }
    else
    {
    c = a + 3 * b;
    }
    MessageBox.Show(c.ToString());

    }
    Hocam teşekkürler. Desteğiniz için. Son olarak bişey sorabilirmiyim. Diziye nasıl aktarırabilir ?
  • 01-06-2020, 14:45:52
    #6
    NOC adlı üyeden alıntı: mesajı görüntüle
    Hocam teşekkürler. Desteğiniz için. Son olarak bişey sorabilirmiyim. Diziye nasıl aktarırabilir ?
    onu tamamen kaçırmışım 1sn ekleyeyim.

    edit :


           public int[] dizi = new int[5];
    public int i = 0;
    private void Button1_Click(object sender, EventArgs e)
    {
    a = Convert.ToInt32(textBox1.Text);
    b = Convert.ToInt32(textBox2.Text);
    x = Convert.ToInt32(textBox3.Text);
    if(x%2==0)
    {
    c = 2 * a + b;
    
    }
    else
    {
    c = a + 3 * b;
    }
    dizi[i] = c;
    MessageBox.Show(c.ToString());
    MessageBox.Show(dizi[i].ToString());
    i++;
    }
    yine bir edit şimdi düzgünce okudum mesajı
    tek çift bulma

     private void Button2_Click(object sender, EventArgs e)
    {
    for (int j = 0; j<5; j++)
    {
    if (dizi[j] % 2 == 0)
    {
    sayac++;
    }
    
    }
    MessageBox.Show(sayac.ToString() + " sayi cift" + "--------" + (5-sayac).ToString() + " sayi tek");
    }
    edit : bu sefer de maks saayı bulmayı unutmuşum iyice salaklaaştım
     public int max = 0;
    private void Button3_Click(object sender, EventArgs e)
    {
    
    for (int k=0;k<5;k++)
    {
    if (dizi[k]>max)
    {
    max = dizi[k];
    }
    }
    MessageBox.Show(max.ToString());
            }