cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Creating a Random Number Generator
Creating a Random Number Generator
Mar 5, 2014 at 4:58am UTC
lifeintechnicolorii
(4)
Hey guys quick question here,
How would I go about creating a random number generator (or pseduorandom I suppose) with user inputted lower and upper bounds along with a user inputted size of the sequence (so they can select how many random numbers they'd like outputted)?
Any help would be appreciated, thanks!
Mar 5, 2014 at 5:39am UTC
giblit
(3750)
Are you talking about actually creating the generator or getting a select number of pseudo random numbers within a range?
If the later you could use one of the several pseudo random generators provided in the random library.
http://www.cplusplus.com/reference/random/
Mar 5, 2014 at 6:32am UTC
lifeintechnicolorii
(4)
I'd be actually creating one the random number generator. Hmm.
Mar 5, 2014 at 6:37am UTC
giblit
(3750)
Well you are going to have to create a formula then here is something to get you started
http://en.wikipedia.org/wiki/Random_number_generation
http://en.wikipedia.org/wiki/Linear_congruential_generator
Last edited on
Mar 5, 2014 at 6:37am UTC
Topic archived. No new replies allowed.