My output is 20 random 1\'s, not between 10 and 1, can anyone explain why this is happening?
#include
#include
#include <
Visual studio 2008 has no trouble with that program at all and happily generates a swathe of random numbers.
What I would be careful of is the /(RAND_MAX +1.0) as this will likely fall foul of integer problems and end up with a big fat zero.
Cast to double before dividing and then cast back to int afterwards