gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
expanded sample size, first version
[mjc2wsl.git] / samples / alpha-mj-exp / gcd-proc-predef.mj
diff --git a/samples/alpha-mj-exp/gcd-proc-predef.mj b/samples/alpha-mj-exp/gcd-proc-predef.mj
new file mode 100644 (file)
index 0000000..e476649
--- /dev/null
@@ -0,0 +1,20 @@
+program procgcdinput{
+
+       int gcd(int a, int b)
+       {
+               while (a != b) {
+                       if (a>b) 
+                               a = a-b;
+                       if (a<b)
+                               b = b-a;
+               }
+               return a;
+       }
+       
+       void main()
+               int a;
+               int b;
+       {
+               print(gcd(12,8),3);
+       }
+}
\ No newline at end of file
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner