using System;
using static System.Console;
namespace Primes
{
class Program
{
static void Main(string[] args)
{
for (int a = 1; a < 10; a++)
{
Console.Write($"a is: {a}\n");
Prime(a);
}
}
private static void Prime(int a)
{
if (a != 2 && a % 2 == 0)
{
Write($"{a} is not prime");
return;
}
int b = 1;
while (b <= a)
{
if (a % b == 0)
{
Write($"b is: {b}\n");
Write(" Prime status is: {0}\n",
(a != b && b != 1) ? "false" : "true");
}
Write($" b after increment is: {++b}\n");
}
Write("exit test else\n\n");
}
}
}
Comments