rand()
Learn how to use the rand() function to return a random number.
Returns a random number.
rand()
rand(1000)
Syntax
rand()- returns a value of typerealwith a uniform distribution in the range [0.0, 1.0).rand(N)- returns a value of typerealchosen with a uniform distribution from the set {0.0, 1.0, …, N - 1}.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.