diff options
Diffstat (limited to 'Examples/php/simple/example.c')
-rw-r--r-- | Examples/php/simple/example.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Examples/php/simple/example.c b/Examples/php/simple/example.c new file mode 100644 index 0000000..2fe2756 --- /dev/null +++ b/Examples/php/simple/example.c @@ -0,0 +1,23 @@ +/* File : example.c */ +#include <stdio.h> + +/* A global variable */ +double Foo = 3.0; + +void print_Foo() { + printf("In C, Foo = %f\n",Foo); +} + +/* 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; +} + + |