Use the rand function from math.h