![]() |
|
,
0 Comments
)
|
| Subject:
c++ programming
Category: Computers > Algorithms Asked by: purplepit-ga List Price: $6.00 |
Posted:
26 Mar 2003 07:21 PST
Expires: 25 Apr 2003 08:21 PDT Question ID: 181143 |
I need to develop a function in C++, to generate random numbers (rand()) within a range, the function should have two integer arguments to indicate the low and high values of the range, using assert!!! |
|
| Subject:
Re: c++ programming
Answered By: ufphoenix-ga on 26 Mar 2003 14:34 PST Rated: ![]() |
assuming you want integer values:
#include <stdlib.h>
int randrange(int low, int high) {
return rand() % (high - low + 1) + low;
}
Regards! |
purplepit-ga
rated this answer:
Thank you very much!! Your answer was very very helpful. Anthony |
|
| There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |