#ZyBook 2.17
19 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
@thorn snow
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
rand takes no arguments
I took out the arguments(seedval) but it still says it's wrong.
Ok so I did and now I tried doing %9 after them to get the values and I passed the first test but not the second
are you passing seedVal to srand
thats what the assignment asks you to do
yeah, I think so. I got srand((int) time(0));
that is not passing seedVal to srand
passing seedVal to srand would look like srand(seedVal);
Oh ok, now I am getting one of the # right on each test. sorry, I don't have a good teacher and the book teaches more than he does.
rand() returns a integer between 0 and RAND_MAX, not 0 and 9
you need to use the modulo operation % to constrain it between 0 and 9
ok, I think I did that but I did rand()%9 for both lines
ok, I think I did that but I did rand()%9 for both lines
its ten
how do I close this
solved!