Facebook
From Sweltering Elephant, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 129
  1. Console.Write("Bir sayi giriniz =");
  2.             int sayi2 = Convert.ToInt32(Console.ReadLine());
  3.             int sayac = 0;
  4.             for (int sayi = 2; sayi <= sayi2; sayi++)
  5.             {
  6.                 int kontrol = 0;
  7.  
  8.                 for (int i = 2; i < sayi; i++)
  9.                 {
  10.                     if (sayi % i == 0)
  11.                     {
  12.                         kontrol = 1;
  13.                     }
  14.                 }
  15.                 if (kontrol == 1)
  16.                 {
  17.                  
  18.                 }
  19.                 else
  20.                 {
  21.                     Console.WriteLine(sayi);
  22.                     sayac++;
  23.                 }
  24.             }
  25.             Console.ReadKey();