• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

random number

is there a way to make rand() = either a 1 or a 0?
0
scotts28
Asked:
scotts28
1 Solution
 
Dave_AndersonCommented:
Take the result and % 2.

So result % 2 will give you either a 1 or 0.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now