From b046d9c9f844b45dd013fa4f196f3097ae4d8c9e Mon Sep 17 00:00:00 2001 From: Adi Arbib Date: Mon, 12 Sep 2016 14:42:51 +0300 Subject: [PATCH] Completed IsPrime and Sort --- GitHubTestProject/Program.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/GitHubTestProject/Program.cs b/GitHubTestProject/Program.cs index b910941..594d4d6 100644 --- a/GitHubTestProject/Program.cs +++ b/GitHubTestProject/Program.cs @@ -11,6 +11,7 @@ static void Main(string[] args) { Console.WriteLine("Hello Github!"); Console.WriteLine("Please complete the following functions and initate a pull request."); + } /// @@ -21,7 +22,12 @@ static void Main(string[] args) public static bool IsPrime(int n) { // TODO: Complete fhe funtion - return n % 2 != 0; + for (int i = 2; i < n; i++) + { + if (n % i == 0) + return false; + } + return true; } /// @@ -31,6 +37,8 @@ public static bool IsPrime(int n) public static void Sort(int[] a) { // TODO: Complete fhe funtion + Array.Sort(a); } + } }