prova con

#include <time.h>

void randomize(void);

int random(int max);

genera un numero (casuale se ricordo bene) tra 0 e max-1

ciao