//Algorithm to check if a number is Prime or not?
//This C# Program Checks Whether the Given Number is a Prime number if so then Display its Largest Facor.
//Here first the number that is obtained is checked whether the number is prime or not and then the largest factor of it is displayed.
//A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.
using System;
public class Program
{
public static void Main()
Console.Write("Enter a Number : ");
int number, count=0;
number = Convert.ToInt32(Console.ReadLine());
for(int i = number-1; i>1; i--){
if (number%i ==0){
count ++;
}
if (count >1){
Console.Write("It is not a Prime number : ");
else{
Console.Write("It is a Prime number : ");