random numbers

+1 Smn Ard · March 23, 2015
Hi I want to generate random numbers
Between two double values a & b .
But rand() deals with integers only !!

Post a Reply

Replies

Oldest  Newest  Rating
+1 Faha Sharapov · March 24, 2015
This must be not the best way, but still you can do like:

double a;
srand(time(0));
a=(double)rand()/(double)rand();

declare the same method for a variable b.
  • 1

C++

107,057 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator