using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PrimeNumber
{
class Math
{
static void Main(string[] args)
{
Console.WriteLine("Enter a Number : ");
try
{
int num = int.Parse(Console.ReadLine());
if (num == 2 || num == 3 || num == 5 || num == 7)
{
Console.WriteLine("Entered number is Prime number");
}
else if (num % 2 != 0 && num % 3 != 0 && num % 5 != 0 && num % 7 != 0)
{
Console.WriteLine("Entered number is prime number");
}
else
{
Console.WriteLine("Entered number is not prime");
}
}
catch(Exception ee)
{
Console.WriteLine("Exception Raised Please Enter the valid number",ee);
}
Console.ReadLine();
}
}
}