aboutsummaryrefslogtreecommitdiff
path: root/Examples/guile/simple/example.c
blob: dcafc4dc4969f9b417fab146f7fcc787e687a830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Simple example from documentation */
/* File : example.c */

#include <time.h>

double My_variable = 3.0;

int fact(int n) {
  if (n <= 1) return 1;
  else return n*fact(n-1);
}

int mod(int n, int m) {
  return (n % m);
}

char *get_time() {
  long ltime;
  time(&ltime);
  return ctime(&ltime);
}