How to generate random numbers in C:

#include<stdlib.h>
.
.
double x, y, z;
.
.
/* assign random numbers to x,y,z -- uniformly distributed in [0,1) */
x = drand48();
y = drand48();
z = drand48();
.
.


 Back