int a = Convert.ToInt32(Console.ReadLine()); // tanári 1.mo int b = a; int c = 0; while (b>=1 && c<=2) { if (a % b == 0) { c++; b--; } else { b--; } } if (c == 2) { Console.WriteLine("prím"); } else { Console.WriteLine("nem prím"); } Console.ReadKey();