Whenever I run the following program the returned values are always 6 or 13.
#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdlib>
using namespace std;
//void randomLegs();
//void randomPush();
//void randomPull();
//void randomMisc();
int main(int argc, const char * argv[])
{
srand(time(NULL));
//randomLegs();
cout << rand() % 14;
return 0;
}
I have run the program close to a hundred times during today and yesterday.
Can anyone tell me what I'm doing wrong?
Thank you.
EDIT: By the way, if I change the range of rand() to say 13 or 15 it works just fine.
rand
is guarantted to meet, don't userand
. – Inclinometer