﻿namespace IsPrime
{
    using System;

    public class Startup
    {
        public static void Main(string[] args)
        {
            Console.Write("Enter a positive integer number: ");

            var number = uint.Parse(Console.ReadLine());
            var divisor = 2u;
            var maxDivisor = (uint)Math.Sqrt(number);
            var isPrime = true;

            while (isPrime && (divisor <= maxDivisor))
            {
                if (number % divisor == 0)
                {
                    isPrime = false;
                }

                divisor++;
            }

            Console.WriteLine($"Prime? {isPrime}");
        }
    }
}
