﻿/*
 * Write an expression that checks if given positive integer number n (n <= 100) is prime
 * (i.e. it is divisible without remainder only to itself and 1).
 * Note: You should check if the number is positive
 */
using System;

class P08_PrimeNumberCheck
{
    static void Main()
    {
        Console.Write("Type an integer number: ");
        int number = int.Parse(Console.ReadLine());
        bool primality = true;

        if (number < 0)
        {
            Console.WriteLine("Please restart and type a posiitive number.");
            return;
        }

        for (int i = 2; i < Math.Sqrt(number); i++)
        {
            if (number % i == 0)
            {
                primality = false;
                break;
            }
        }

        Console.WriteLine("Number {0} is primal: {1}.", number, primality);
    }
}