Skip to content

Instantly share code, notes, and snippets.

@aysegulsarikaya
Created January 26, 2019 20:00
Show Gist options
  • Select an option

  • Save aysegulsarikaya/aa8efd6b4d3f1052b1094765ab5ec9a1 to your computer and use it in GitHub Desktop.

Select an option

Save aysegulsarikaya/aa8efd6b4d3f1052b1094765ab5ec9a1 to your computer and use it in GitHub Desktop.
Asal Sayı
static void Main(string[] args)
{
int sayac = 0;
for (int sayi = 2; sayi <= 100; sayi++)
{
int status = 0;
for (int i = 2; i < sayi; i++)
{
if (sayi % i == 0)
{
status = 1;
break;
}
}
if (status != 1)
{
Console.WriteLine("{0}. asal sayı: {1} ", sayac,sayi);
sayac++;
}
}
Console.ReadKey();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment