c get random float code example Example: c get random float //random float between 0 and a float x = (float)rand()/(float)(RAND_MAX/a);