21 Aralık 2013 Cumartesi

C # PROGRAMI İLE ÖRNEK SORULAR-15

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace sınıflar
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Visible = false;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.Visible = true;
        }


       
    }

}

C # PROGRAMI İLE ÖRNEK SORULAR-14

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace sınıflar
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void button1_Click_1(object sender, EventArgs e)
        {
            textBox1.TextAlign = HorizontalAlignment.Right;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.TextAlign = HorizontalAlignment.Center;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.TextAlign = HorizontalAlignment.Left;
        }
    }

}

C # PROGRAMI İLE ÖRNEK SORULAR-13

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace sınıflar
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void button1_Click_1(object sender, EventArgs e)
        {
            DateTime ilk, son;
            ilk = Convert.ToDateTime(textBox1.Text);
            son = Convert.ToDateTime(textBox2.Text);
            MessageBox.Show("hesaplanan gün="    +(son-ilk));
        }
    }
}


C # PROGRAMI İLE ÖRNEK SORULAR-12

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace arka_artırım
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i, ilk, son, deger;
            float sonuc = 0;
            ilk = Convert.ToInt32(textBox1.Text);
            son = Convert.ToInt32(textBox2.Text);
            if (ilk > son)
            {
                deger = ilk;//ilk ile son değişkenin değerleri değiştirilerek
                ilk = son;//ilk değişkenin hep küçük olması sağlanıyor
                son = deger;
            }
            if (ilk % 2 != 0)
            {
                ilk++;//ilk tek sayı ise onu bir büyüt çift sayı olsun
            }
            for (i = ilk; i <= son; i += 2)
            {
                sonuc += i;
            }
            MessageBox.Show("sonuç="    +sonuc);
        }



    }}    

C # PROGRAMI İLE ÖRNEK SORULAR-11

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace arka_artırım
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int notu;
            notu = Convert.ToInt32(textBox1.Text);//text deki veri tam sayıya çevriliyor
            if (notu > 100)
            {
                MessageBox.Show("yanlış not girdiniz");
            }
            else if (notu >= 50)
            {
                MessageBox.Show("dersi geçtiniz");
            }
            else
            {
                MessageBox.Show("dersten kaldınız");
            }
        }

       
    }
}






C # PROGRAMI İLE ÖRNEK SORULAR-10

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace arka_artırım
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int a = 15;
            int b = 205;
            MessageBox.Show("eski b=" + b);
            MessageBox.Show("eski a=" + a);
            b = ++a;
            MessageBox.Show("yeni b="     +b);
            MessageBox.Show("yeni a="   +a);
        }

        
    }
}


C # PROGRAMI İLE ÖRNEK SORULAR-9

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace arka_artırım
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int a = 15;
            int b = 205;
            MessageBox.Show("eski b=" + b);
            MessageBox.Show("eski a=" + a);
            b = a++;//a'nın değeri 1 artarak a ya atanır.b=15 a=16 olur
            MessageBox.Show("yeni b="     +b);//15 yazar
            MessageBox.Show("yeni a="   +a);//16 yazar
        }

       
    }

}

C # PROGRAMI İLE ÖRNEK SORULAR-8

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace tek_çift
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int x,k;
           
            x = Convert.ToInt32(textBox1.Text);
            k = x%2;
            if (k == 0)
            {
               
                MessageBox.Show("sayı çiftir");
            }
            else
            {
              
                MessageBox.Show("sayı tektir");
            }

        }
    }

}

C # PROGRAMI İLE ÖRNEK SORULAR-7

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace dört_işlem
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double x, y, z;
            x = Convert.ToDouble(textBox1.Text);
            y = Convert.ToDouble(textBox2.Text);
            z = x + y;
            textBox3.Text = z.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            double x, y, z;
            x = Convert.ToDouble(textBox1.Text);
            y = Convert.ToDouble(textBox2.Text);
            z = x -y;
            textBox3.Text = z.ToString();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            double x, y, z;
            x = Convert.ToDouble(textBox1.Text);
            y = Convert.ToDouble(textBox2.Text);
            z = x *y;
            textBox3.Text = z.ToString();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            double x, y, z;
            x = Convert.ToDouble(textBox1.Text);
            y = Convert.ToDouble(textBox2.Text);
            z = x/y;
            textBox3.Text = z.ToString();
        }
    }
}


C # PROGRAMI İLE ÖRNEK SORULAR-6

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace dikdörtgen_alanı
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int x, y, z;
            x = Convert.ToInt32(textBox1.Text);
            y = Convert.ToInt32(textBox2.Text);
            z = x * y;
            textBox3.Text = z.ToString();
        }
    }

}

C # PROGRAMI İLE ÖRNEK SORULAR-5

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace deprem
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double siddet;
            string durum = "";
            siddet = Convert.ToDouble(textBox1.Text);
            if (siddet < 5.0)
            {
                durum = "önemsiz sarsıntı";
                textBox2.Text = durum.ToString();
               
            }
            else if (5.0 < siddet && siddet < 5.5)
            {
                durum = "az hasarlı";
                textBox2.Text = durum.ToString();
            }
            else if (5.5 <= siddet && siddet < 6.5)
            {
                durum = "ciddi hasarlı";
                textBox2.Text = durum.ToString();
            }
            else if (6.5 <= siddet && siddet < 7.5)
            {
                durum = "felaket";
                textBox2.Text = durum.ToString();
            }
            else if (7.5 <= siddet)
            {
                durum = "ALLAH YARDIMCIMIZ OLSUN";
                textBox2.Text = durum.ToString();
            }

            textBox2.Text = durum.ToString();
        }
    }

}

C # PROGRAMI İLE ÖRNEK SORULAR-4

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace faktöriyel
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i;
            double sayi, fakt = 1;
            sayi = Convert.ToDouble(textBox1.Text);
            for (i = 1; i <= sayi; i++)
            {
                fakt = fakt * i;
            }

            textBox2.Text = fakt.ToString();
        }
    }
}


C # PROGRAMI İLE ÖRNEK SORULAR-3

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace derece
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
            double celcius,fahren;
            fahren = Convert.ToDouble(textBox1.Text);


            celcius = (fahren- 32) / 1.8;
            textBox2.Text = celcius.ToString();
        }
    }

}