public static bool IsPrime(int number) { bool IsPrime = true; if (number <= 1) return IsPrime; for (int i = 2; i <= Math.Sqrt(number); i++) { if (number % i == 0 && i != number) IsPrime = false; } return IsPrime; }Thanks, Karthik KK
public static bool IsPrime(int number) { bool IsPrime = true; if (number <= 1) return IsPrime; for (int i = 2; i <= Math.Sqrt(number); i++) { if (number % i == 0 && i != number) IsPrime = false; } return IsPrime; }Thanks, Karthik KK