/* random.c */ /* randomly generate a number between (0 ~ 4999)*/ /* author: Weiwei Chen */ /* date: Oct. 17. 2010 */ /*preprocessor directives*/ #include #include #include int main(void) { /*variable definition*/ int n; /*computation section*/ srand(time(NULL)); n = rand() % 5000; /*output section*/ printf("I got a random number: %d. \n", n); return 0; }