Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / test-prime.cs
1 using System;
2
3 class Test {
4         public static bool testprime (int x) {
5                 if ((x & 1) != 0) {
6                         for (int n = 3; n < x; n += 2) {
7                                 if ((x % n) == 0)
8                                         return false;
9                         }
10                         return true;
11                 }
12                 return (x == 2);
13         }
14
15         public static int Main () {
16                 if (!testprime (17))
17                         return 1;
18                 return 0;
19         }
20 }