KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The following code outputs a random number each second: int main () { srand(time(NULL)); // Seeds number generator with execution time. while (true) { int rawRand = rand(); std::cout << rawRand << std::endl; sleep(1); } } How might I size these numbers down so they're always in the range of 0-100?
Tags (comma-separated)
Save Edits
Cancel