Hızlı yanıt: kod örneği
Note: Don't use for security. If you need a cryptographically secure number, see this answer instead.On Linux, you might prefer to use random and srandom.
rand()
#include <time.h>#include <stdlib.h>srand(time(NULL)); // Initialization, should only be called once.int r = rand(); // Returns a pseudo-random integer between 0 and RAND_MAX.