using System.Collections.Generic;
using System.Threading.Tasks;
namespace ConsoleApplication3
public static bool isPrime(int n)
if (n == 1) return false;
for (int i = 2; i < n; i++)
if (n % i == 0) return false;
public static void MinPrimeNumber()
StreamReader sr = new StreamReader(@"C:\Users\Asus\Desktop\111.txt");
StreamWriter sw = new StreamWriter(@"C:\Users\Asus\Desktop\1.txt");
string[] arr = sr.ReadLine().Split();
foreach (string a in arr)
if (b < min && isPrime(b))
sw.WriteLine("The smallest Prime Number is:" + min);
static void Main(string[] args)