Update Haiku support (#15674)
[mono-project.git] / mono / tests / test-prime.cs
blob28ffb3de4ada7f167af71fb70d702f2053b51c24
1 using System;
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;
10 return true;
12 return (x == 2);
15 public static int Main () {
16 if (!testprime (17))
17 return 1;
18 return 0;