Created
January 26, 2019 20:00
-
-
Save aysegulsarikaya/aa8efd6b4d3f1052b1094765ab5ec9a1 to your computer and use it in GitHub Desktop.
Asal Sayı
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
| 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