Proposed exercise
Write a program which asks the user for an integer number and answers if it is a prime number or not.
Output
Solution
using System; public class Prime { public static void Main() { int number, divider=2; Console.Write("Enter a number: "); number = Convert.ToInt32(Console.ReadLine()); while( number % divider != 0) divider++; if (divider == number) Console.WriteLine("Is prime!!!"); else Console.WriteLine("Is not prime!!!"); } }