public static void Main()
Console.WriteLine("Enter the limit: ");
y = int.Parse(Console.ReadLine());
for (int x = 2; x < y; x++)
if (Isprimarry(x) == true)
Console.WriteLine("the number {0} is primarry\n",x);
Console.WriteLine("in total there is " + count + " primarry numbers.");
public static bool Isprimarry(int x)
for (int i = 2; i < x; i++)
if (x % i == 0 && x / 2 != 0)