PageRenderTime 37ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/guile/simple/example.c

#
C | 21 lines | 14 code | 5 blank | 2 comment | 2 complexity | a8c48972e5f7013b1061325f682d0858 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* Simple example from documentation */
  2. /* File : example.c */
  3. #include <time.h>
  4. double My_variable = 3.0;
  5. int fact(int n) {
  6. if (n <= 1) return 1;
  7. else return n*fact(n-1);
  8. }
  9. int mod(int n, int m) {
  10. return (n % m);
  11. }
  12. char *get_time() {
  13. long ltime;
  14. time(&ltime);
  15. return ctime(&ltime);
  16. }