Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <ctime>
- using namespace std;
- int random(int numr1, int numr2) // generate random number from numr1 to numr2 inclusively
- {
- return (numr1 >= numr2) ? (0) : ((rand() % ((numr2 - numr1)+1)) + numr1);
- }
- int main()
- {
- srand(time(NULL));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement