I am trying to write a prime number function in C# and I am wondering if the follow code will work. It \"appears\" to work with the first 50 numbers or so. I just want to ma
It had to be done...
public static bool IsPrime(this int number) { return (Enumerable.Range(1,number).Where(x => number % x == 0).Count() == 2); }