How can we create a function of our own to generate random numbers ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can we create a function of our own to generate random numbers ?

25th Feb 2017, 2:39 AM
Ankush Subham
Ankush Subham - avatar
2 Answers
+ 9
This was the first official assignment I had during my first semester studying CS in my university. You have to create your own equation to "randomise" the output from a set of integers, probably stored in arrays. If you are prohibited from using any built-in function at all, you may utilise <fstream> to store and alter your seed value and equation each time you start your program so that the values will always be different.
25th Feb 2017, 3:43 AM
Hatsy Rei
Hatsy Rei - avatar
0
thank you for your suggestion
26th Feb 2017, 5:50 PM
Ankush Subham
Ankush Subham - avatar