Hello Young Padawans!
Well, I honestly though I had already done this post, but apparently, I didn´t so, here It is
This one was a litle tricky, because, I to do some research on the internet first, to know how to get a random number in a specific range, but after i got it it was easy, so I did my code and It worked, only with one little detail, the random function always gave me the same number:
I don´t know why it always got me 84, but it did, ALWAYS, so I checked on some of my classmates codes and they have all something different, and that something was the:
” srand(time(NULL)); ”
This thing results to give you a different number every time the code is ran.
So the final result was something like this:
So, I just added the cookie thing because, Come On! Is a “Hole in one”, and everybody deserves a Cookie, here have one:
You forgot to give credits
LikeLike