WSQ06 – Pick a Number

HI, first of all let me tell you something…. THIS WAS HARD.
But as i have mentionated i have a friend wos name is chuy and he is a master of C++ so he helped me.

But now let us talk about the program, the program choose a random number between 1-100 and the funny thing is that you have to find it C: it is not that difficult, the hard part was generating te random number. Let me explain you with the program

PROGRAM

Here is the main part

srand(time(NULL));
ranm= 1+ rand()%100;

And that is all jaja, the first line make that your program choose different number and not always the same, and the second one is the range, you tell the computer give me a random number between 1-100 but as we know when the modulus is operating the bigger number you can have is 99 therefore we add 1

The second part of the program is easier, it is only a cycle, when you are trying to find the number the program tells you if you are high or low until you find the number, and every time you try it is one chance, at the and the program also tells you how many chances you had.

See you.

CC BY-SA 4.0 WSQ06 – Pick a Number by alibarramg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.