1. How to generate 0 and 1 in a random way in C99?
2. How to generate any 2 number in a random way from 1 to n in C99?
1. How to generate 0 and 1 in a random way in C99?
2. How to generate any 2 number in a random way from 1 to n in C99?
Anything can be done with inbuilt C functions please?
I have no knowledge of random number generators! So cannot implement this without theoretical knowledge!
srand() and rand() are part of the C standard library and can be found in <stdlib.h>.Anything can be done with inbuilt C functions please?
Do something about your ignorance by reading:I have no knowledge of random number generators! So cannot implement this without theoretical knowledge!
Using rand()
Random Numbers Tutorial
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
and keep in mind that the "random" numbers from the rand() follow a uniform distribution.