/trunk/Examples/mzscheme/simple/example.c
# · C · 24 lines · 14 code · 6 blank · 4 comment · 2 complexity · 92f0e6c6da86d43b8f31dcd5671aaf09 MD5 · raw file
- /* Simple example from documentation */
- /* File : example.c */
- #include <time.h>
- double My_variable = 3.0;
- /* Compute factorial of n */
- int fact(int n) {
- if (n <= 1) return 1;
- else return n*fact(n-1);
- }
- /* Compute n mod m */
- int my_mod(int n, int m) {
- return (n % m);
- }
- char *get_time() {
- long ltime;
- time(<ime);
- return ctime(<ime);
- }