C# Örnekleri -1

TL-11-A sınıfından Ertan’ın yapmış olduğu klavyeden girilen 3 sayıyı karşılaştıran program;
int sayi1, sayi2, sayi3, a, b, c;

Console.WriteLine(“1.Sayıyı girin”);
sayi1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“2.Sayıyı girin”);
sayi2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“3.Sayıyı girin”);
sayi3 = Convert.ToInt32(Console.ReadLine());
if ((sayi1 > sayi2) && (sayi1 > sayi3))
{
a = sayi1;

if (sayi2 > sayi3)
{
b = sayi2;

c = sayi3;
Console.Write(“{0}>{1}>{2}”, a, b, c);
Console.ReadLine();
}
if (sayi3 > sayi2)
{
b = sayi3;

c = sayi2;
Console.Write(“{0}>{1}>{2}”, a, b, c);
Console.ReadLine();
}

}
if ((sayi2 > sayi1) && (sayi2 > sayi3))
{
a = sayi2;

if (sayi1 > sayi3)
{
b = sayi1;

c = sayi3;
Console.Write(“{0}>{1}>{2}”, a, b, c);
Console.ReadLine();
}
if (sayi3 > sayi1)
{
b = sayi3;

c = sayi1;
Console.Write(“{0}>{1}>{2}”, a, b, c);
Console.ReadLine();
}

}
if ((sayi3 > sayi1) && (sayi3 > sayi2))
{
a = sayi3;

if (sayi1 > sayi2)
{
b = sayi1;

c = sayi2;
Console.Write(“{0}>{1}>{2}”, a, b, c);
Console.ReadLine();
}
if (sayi2 > sayi1)
{ b = sayi2;
c = sayi1;
Console.Write(“{0}>{1}>{2}”, a, b, c);
Console.ReadLine();

2 comments on “C# Örnekleri -1

  1. Pingback: C# Örnekleri -2 | rtyucel.com Mesleki Eğitim BT blogu

  2. hocam bizim için coçuk oyuncağıı :D

Yorum yapın

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Değiştir )

Twitter picture

You are commenting using your Twitter account. Log Out / Değiştir )

Facebook photo

You are commenting using your Facebook account. Log Out / Değiştir )

Connecting to %s