/trunk/Examples/ocaml/simple/example.c

# · C · 18 lines · 11 code · 4 blank · 3 comment · 1 complexity · e23a52329483450248d1cc30b9f369a0 MD5 · raw file

  1. /* File : example.c */
  2. /* A global variable */
  3. double Foo = 3.0;
  4. /* Compute the greatest common divisor of positive integers */
  5. int gcd(int x, int y) {
  6. int g;
  7. g = y;
  8. while (x > 0) {
  9. g = x;
  10. x = y % x;
  11. y = g;
  12. }
  13. return g;
  14. }