aboutsummaryrefslogtreecommitdiff
path: root/Examples/javascript/simple/example.c
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/javascript/simple/example.c')
-rw-r--r--Examples/javascript/simple/example.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Examples/javascript/simple/example.c b/Examples/javascript/simple/example.c
new file mode 100644
index 000000000..1c2af789c
--- /dev/null
+++ b/Examples/javascript/simple/example.c
@@ -0,0 +1,18 @@
+/* File : example.c */
+
+/* A global variable */
+double Foo = 3.0;
+
+/* Compute the greatest common divisor of positive integers */
+int gcd(int x, int y) {
+ int g;
+ g = y;
+ while (x > 0) {
+ g = x;
+ x = y % x;
+ y = g;
+ }
+ return g;
+}
+
+