/trunk/Examples/mzscheme/simple/example.c
C | 24 lines | 14 code | 6 blank | 4 comment | 2 complexity | 92f0e6c6da86d43b8f31dcd5671aaf09 MD5 | raw file
1/* Simple example from documentation */ 2/* File : example.c */ 3 4#include <time.h> 5 6double My_variable = 3.0; 7 8/* Compute factorial of n */ 9int fact(int n) { 10 if (n <= 1) return 1; 11 else return n*fact(n-1); 12} 13 14/* Compute n mod m */ 15int my_mod(int n, int m) { 16 return (n % m); 17} 18 19 20char *get_time() { 21 long ltime; 22 time(<ime); 23 return ctime(<ime); 24}