Created
November 1, 2024 11:05
-
-
Save ahmetcanisik/4d4e1307124154e3434a15c55e663d1d to your computer and use it in GitHub Desktop.
[Girilen Üç Sayıdan En Büyüğünü Bul] girilen üç sayıdan en büyük olanı bulan program örneği #charp #c$
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Cryptography.X509Certificates; | |
namespace ConsoleApp1 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int eb = 0; | |
Console.Write("Birinci sayınızı giriniz: "); | |
int sayi1 = Convert.ToInt16(Console.ReadLine()); | |
Console.Write("İkinci sayınızı giriniz: "); | |
int sayi2 = Convert.ToInt16(Console.ReadLine()); | |
Console.Write("Üçüncü sayınızı giriniz: "); | |
int sayi3 = Convert.ToInt16(Console.ReadLine()); | |
if (sayi1 > sayi2 && sayi1 > sayi3) | |
{ | |
eb = sayi1; | |
} | |
if (sayi2 > sayi1 && sayi2 > sayi3) | |
{ | |
eb = sayi2; | |
} | |
if (sayi3 > sayi1 && sayi3 > sayi2) | |
{ | |
eb = sayi3; | |
} | |
switch (eb) | |
{ | |
case int n when n == sayi1: | |
Console.WriteLine("En büyük sayı ilk girilen sayıdır."+sayi1); | |
break; | |
case int n when n == sayi2: | |
Console.WriteLine("En büyük sayı ikinci girilen sayıdır."+sayi2); | |
break; | |
case int n when n == sayi3: | |
Console.WriteLine("En büyük sayı üçüncü girilen sayıdır."+sayi2); | |
break; | |
default: | |
Console.WriteLine("Sayılardan en büyük olan bulunamıyor!"); | |
break; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment