+ 1
Help finish code which should output a random number up to 10, help I do not know where is my error, help I'm a noob?!
4 ответов
+ 1
This version outputs 10 random numbers. You had a couple missing semicolons and invalid symbols
https://code.sololearn.com/cxmZbpELoS4m/?ref=app
+ 2
Thomas Williams Thank you very much for your help and answer 😀
+ 1
Thomas Williams A huge thank you, please explain why you need two variables and x = rand() % 10 + 1; ?!
+ 1
Variable x was used to hold the random number. I could even have skipped it😉
Variable d was what controlled the loop. Once d became 10 the loop would be terminated