Home » C Programming » C-Library-Functions » Question
  1. Which of these is a correct way to generate numbers between 0 to 1(inclusive) randomly?
    1. rand() % 2
    2. rand(0, 1)
    3. rand() / RAND_MAX
    4. All of above
    5. None of these
Correct Option: A

rand() % 2



Your comments will be displayed only after manual approval.