Evet resimde görülen kadar teknolojik bir yapı değil ama yine de işimizi görecek bir console uygulaması.int Sayi1 = 0;
float Sayi2 = 0;
float Sonuc = 0;
string İslem;
Console.WriteLine("İlk Sayiyi Giriniz");
Sayi1 = Convert.ToInt32(Console.ReadLine());
while(true)
{
Console.WriteLine("Bir islem Seçiniz : + - / * ");
İslem = Convert.ToString(Console.ReadLine());
if (İslem == "-" İslem == "+" İslem == "*" İslem == "/")
{
Console.WriteLine("İkinci Sayiyi Giriniz");
Sayi2 = Convert.ToInt32(Console.ReadLine());
if (İslem == "+")
{
Sonuc = Sayi1 + Sayi2;
}
else if (İslem == "-")
{
Sonuc = Sayi1 - Sayi2;
}
else if (İslem == "*")
{
Sonuc = Sayi1 * Sayi2;
}
else if (İslem == "/")
{
Sonuc = Sayi1 / Sayi2;
}
Console.WriteLine("\n"+Sayi1 + İslem + Sayi2 + "=" + Sonuc);
break;
}
Console.WriteLine("HATALI SEÇİM YAPTINIZ");
}
Murat KALKAN
Hiç yorum yok:
Yorum Gönder