From bcde99fbe99174a094f38fdda70ad69d65a423f4 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Wed, 30 Apr 2014 17:19:08 +0200 Subject: Fist commit (WIP) --- examples/gcd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/gcd.c (limited to 'examples/gcd.c') diff --git a/examples/gcd.c b/examples/gcd.c new file mode 100644 index 0000000..1f66332 --- /dev/null +++ b/examples/gcd.c @@ -0,0 +1,12 @@ +a = -26134272; +b = 26396928; + +if (a < 0) a = -a; +if (b < 0) b = -b; +while (b > 0) { // try changing this to b >= 0 + tmp = b; + b = a % b; + a = tmp; + } +print (a); // this should print 131328 + -- cgit v1.2.3