Hi,
can somebody tell me how i can generate a random number sequence,within a specific range?
kaos
0
Newbie Poster
Recommended Answers
Jump to Postuse the mod operator % to get a value from 0 to some upper-limit. For example to get a random number between 0 and 100
int num = rand() % 100;
Much more information
Jump to PostBut i would'nt get a sequence,what i need is a sequence,ie a the numbers should not be repeated in my sequence,all numbers must be unique.
There are some decent threads here on Daniweb regarding this. Type in "random numbers unique", "random numbers no duplicate", without the quotes, and similar, and …
All 6 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
kaos
0
Newbie Poster
VernonDozier
2,218
Posting Expert
Featured Poster
Radical Edward
301
Posting Pro
tesuji
135
Master Poster
kaos
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.