summary refs log tree commit diff
path: root/minic/test/prime.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-10-12 16:20:59 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-10-12 16:20:59 -0400
commitccd6bd869c4b793815155432af9d48e1a051679c (patch)
tree6a9ab566dd90cda0287dba8c923af07bcd35182b /minic/test/prime.c
parentcf9916d00d46ab2c067876644f7d38c269448644 (diff)
downloadroux-ccd6bd869c4b793815155432af9d48e1a051679c.tar.gz
fix stupid bug in the example
Diffstat (limited to 'minic/test/prime.c')
-rw-r--r--minic/test/prime.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/minic/test/prime.c b/minic/test/prime.c
index e1d1074..182cb3d 100644
--- a/minic/test/prime.c
+++ b/minic/test/prime.c
@@ -7,9 +7,6 @@ main() {
 	c = 0;
 	n = 2;
 	while (n < 1000) {
-		if (c % 10 == 0)
-		if (c != 0)
-			printf("\n");
 		t = 2;
 		p = 1;
 		while (t*t <= n) {
@@ -18,10 +15,13 @@ main() {
 			t = t + 2;
 		}
 		if (p) {
+			if (c % 10 == 0)
+			if (c != 0)
+				printf("\n");
 			printf("%4d ", n);
 			c++;
 		}
-		n = n + 2;
+		n++;
 	}
 	printf("\n");
 }