IsPrime() public method

public IsPrime ( int n ) : bool
n int
return bool
Example #1
0
 static void Main(string[] args)
 {
     Program p = new Program();
     int n = 999;
     while (!p.IsPrime(n) || !p.IsPalindrome(n))
         n -= 2;
     Console.WriteLine(n);
     Console.ReadLine();
 }
Example #2
0
        static void Main(string[] args)
        {
            Program p = new Program();
            int     n = 999;

            while (!p.IsPrime(n) || !p.IsPalindrome(n))
            {
                n -= 2;
            }
            Console.WriteLine(n);
            Console.ReadLine();
        }