I have an assignment for school, to make a long story short I'm having trouble with the random number generator. I get two errors saying "error: expected expression before ‘=’ token" they give the line number of the printf statment "printf("%d\n", rand() % (HIGH - LOW + 1) +LOW );". I dont understand what the problem is can anyone please help me.
Code:do { /* gets time and convert seconds to unsigned int */ time_t now; time(&now); srand(now); rand(); /*sets the bounds*/ printf("%d\n", rand() % (HIGH - LOW + 1) +LOW ); /* printf("%d", randnum); */ ++count; } while (count <= 11);



LinkBack URL
About LinkBacks


