I'm new at c++ and i want help about a simple guessing number game.
I post the code i have already write. Because i am new, any help are welcome!
- the player has 3 tries (the number is between 0 and 20)
- if player doesnt guess the right number, then the programm will close
- if the player guess the right number then print "congrats" and ask the player if he want a new game.
#include <stdio.h>#include <stdlib.h>
x = rand();
while ( x < 0 || x > 20 );
printf("Put your guess from 0 to 20 please;");
while ( guess < 0 || guess > 20 );
printf ("Congratulations, you guess the right number. Do you want play again?");
printf ("wrong number!");
Thank you very much.