summary refs log tree commit diff
path: root/proto/ctests/eucl.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-07-10 03:16:39 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:27 -0400
commit116f35a44a2f781646dd252a03a3a94ffdcbad5e (patch)
treecd1a4dd61c3ba27ddd60f3149b10f243c87e282f /proto/ctests/eucl.c
parent037c716b6514cc717b7208457fb72085e4c278ab (diff)
downloadroux-116f35a44a2f781646dd252a03a3a94ffdcbad5e.tar.gz
add c version of some tests
Diffstat (limited to 'proto/ctests/eucl.c')
-rw-r--r--proto/ctests/eucl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/proto/ctests/eucl.c b/proto/ctests/eucl.c
new file mode 100644
index 0000000..fd2e9c9
--- /dev/null
+++ b/proto/ctests/eucl.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+int main()
+{
+	int a = 123456;
+	int b = 32223;
+	int t;
+
+	do {
+		t = a % b;
+		a = b;
+		b = t;
+	} while (b);
+
+	printf("%d\n", a);
+	return 0;
+}