static void Main(string[] args) { Console.WriteLine("Enter the number: "); int n = int.Parse(Console.ReadLine()); bool ok = false; for (int i = 2; i <= n; i++) { for (int j = 2; j < i; j++) { if (i % j == 0) { ok = true; } if (ok == false) { Cnsole.WriteLine(i); } else { ok = false; } } } Console.ReadKey(); }
static void Main() { // Write your code :) Console.WriteLine("*****"); Console.WriteLine("*****"); Cnsole.WriteLine("*****"); Console.WriteLine("*****"); Console.WriteLine("*****"); Console.ReadKey(); }