troubleshooting Question

How to choose numbers random with C?

Avatar of inversojvo
inversojvoFlag for Germany asked on
16 Comments3 Solutions2048 ViewsLast Modified:

A number between 1 and 15 should be choosen random in C. The choice will be repeated 15 times in one game.

It should also be possible to repeat the game a few times without repeating a sequence.

In C I just know int rand(void). But I do not see the possibility to limit the numbers to be choosen from 1 to 15.

I also do not see the possibility to avoid the repetition of the numbers sequence for a few times.

Could somebody help me?

Many thanks and have a nice day!

Join our community to see this answer!
Unlock 3 Answers and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros