1 ile 100 arası asal sayıları While döngüsü ile ekrana yazma – C# Console
1 ile 100 arası asal sayıları While döngüsü ile ekrana yazma – C# Console
using System;
using System.Collections.Generic;
using System.Linq;//www.gorselprogramlama.com
using System.Text;
namespace _1_100_arasi_asal_sayılar
{
class Program
{//www.gorselprogramlama.com
static void Main(string[] args)
{
int sayi=0;
bool durum = true;//www.gorselprogramlama.com
while (sayi<100)
{
sayi++;
for (int i = 2; i < sayi; i++)//www.gorselprogramlama.com
{
if (sayi % i == 0) durum = false;
}
if (durum == true) Console.WriteLine(sayi);//www.gorselprogramlama.com
durum = true;
}
Console.ReadKey();//www.gorselprogramlama.com
}
}
}




Çok teşekkür ederim ellerinize sağlık.