I need to generate random integers from 0 to 10 - whats the code?please explain if you can. thanks
Rand function (C)?
http://pegasus.rutgers.edu/~elflord/cpp/...
Reply:If I remember correctly, rand returns if float between 0 and 1. You will need to map that between 0 and 10. Maybe something like y=round(rand()*10);
My C is a little fuzzy right now but something like that should get you going.
blazing star
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment