I don't see the code...
Main Topics
Browse All TopicsHi,
Forgive me if this has been answered before but I can not seem to find a good solution. I have a assignment that wants me to create a fraction quiz that is generated by random numbers. There is an array of 5 fraction sets. I have everything working and I always get a different numerator and denominator, well at least as randomly as possible, but my issue is I always get the same numerator and denominator. When I pause my program in-between fractions I get different numbers and all is well but I do not think that is the best method by far.
I have included the code to my random number generator and I understand that it works on the bases of time. Thanks for any help
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ooops, forgot the docs: http://www.cppreference.co
After retesting my code I noticed that once the first two array elements are populate with the random number I got all the same numbers from then on.
To fix this I put the time seed
srand((unsigned)time(0));
into my set problem function so it will change after each new question is answered and a new one displayed.
I still think the advice to move the seed was the best and I am still thankful.
Business Accounts
Answer for Membership
by: jkrPosted on 2009-03-26 at 13:13:33ID: 23994702
Well, a simple example would be
Select allOpen in new window