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?
Printable View
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>.Quote:
Anything can be done with inbuilt C functions please?
Do something about your ignorance by reading:Quote:
I have no knowledge of random number generators! So cannot implement this without theoretical knowledge!
Using rand()
Random Numbers Tutorial
and keep in mind that the "random" numbers from the rand() follow a uniform distribution.