I'm very new at coding and I'm learning by myself the C.
I'm doing my very first exercice, I gotta creat a "game"("More or Less") which the concept is :
-Computer choose a random number between and 1 and 100.
-And we gotta guess!
-The game ends when you find the Mystery Number.
I put the function loop (do..while) and also the function (if...else) to keep the game going even if you didn't find the mystery number (unless you find!)
It's been a few days that I'm stuck with my code cause, When I debug, nothing happen (so it's a pretty good news) BUT when I run also NOTHING HAPPEN
My code is:
int main( int argc, char*argv[])
{
int numberYouChoose = 0;
int MysteryNumber = 0;
const int MAX = 100, MIN = 1;
printf("What's the number?\n");
scanf("%d", &numberYouChoose);
srand(time(NULL));
MysteryNumber = (rand() % (MAX - MIN + 1)) + MIN;
do{
printf("Boooooh Try again!");
}while(numberYouChoose != MysteryNumber);
if (numberYouChoose == MysteryNumber);
printf("Yay you found it!\n");
return 0;
}