#include <stdio.h> // printf
#include <stdlib.h> // rand, srand
#include <time.h> // time
int MyRand() // You may implement your own Random ;-)
{
static int seed = 1, A = 239017, B = 17239;
seed = A * seed + B;
return seed >> 8;
}
int main()
{
srand(time(NULL)); // time(NULL) = time in seconds, srand = change seed of random
// rand() = 0..RAND_MAX = 32767
printf("%d\n", rand() % 10); // rand() % 10 = random in [0..9]
return 0;
}