using System.Collections.Generic;
static bool IsPrime(long n)
for (int i = 2; i <= Math.Sqrt(n); i ++)
if (n % i == 0) return false;
public static void Main(string[] args)
Console.WriteLine("Program that check whether a given integer number n is prime.");
Console.WriteLine("Write n = ");
long n = long.Parse(Console.ReadLine());
Console.WriteLine("Is number {0} prime ? {1} !", n, Program.IsPrime(n));