January 22nd, 2013, 02:31 PM
Hello (sorry for my bad English)
I must write program who shows for users statistics.
I make 1 or more random where i roll 6 numbers and save it to file.(numbers are in the range 1 to 60)
How to show which two , three and four numbers form every one roll exist most frequently.
Most frequently pair of two number is (32,44) or three (32,42,55) and four is (32,42,55,60)
January 22nd, 2013, 02:48 PM
You will use rand() to get a pseudo-random number. When your program starts, you will use srand() to feed the pseudo-random-number generator a seed value. If you use the same seed value, you will get the same sequence of pseudo-random numbers. If you want it to be "really random", then you would need to feed it a different number each time you run it, such as time().
Google and you will find many discussions and examples. At least now you have some function names to use in your search.
January 22nd, 2013, 03:26 PM
OK now when I run program i get other numbers them last time. But still i do not know how check most frequently pairs of two number three and four.