21 Aralık 2013 Cumartesi

C # PROGRAMI İLE ÖRNEK SORULAR-28

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

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

        private void button1_Click(object sender, EventArgs e)
        {
            int x, y;
            x = Convert.ToInt32(textBox1.Text);
            y = Convert.ToInt32(textBox2.Text);
            if (x > 0 && y > 0)
            {
                textBox3.Text = "1.bölgede";
            }
            else if (x < 0 && y > 0)
            {
                textBox3.Text = "2.bölgede";
            }
            else if (x < 0 && y < 0)
            {
                textBox3.Text = "3.bölgede";
            }
            else if (x > 0 && y < 0)
            {
                textBox3.Text = "4.bölgede";
            }
            else if (x == 0 && y == 0)
            {
                textBox3.Text = "orjinde";
            }
            else if (x == 0 && y != 0)
            {
                textBox3.Text = "y-ekseninde";
            }
            else if (x == 0 && y != 0)
            {
                textBox3.Text = "x-ekseninde";
            }
        }
    }
}


Hiç yorum yok: