Guess The Number C code
#include <stdio.h> #include <stdlib.h> #include <time.h> // for random number generator seed int main() { int randomNumber = 0; int guess = 0; int numberOfGuesses; // Initialization of random number generator srand(time(0)); // get the random number randomNumber = rand() % 21; printf("\nThis is a guessing game."); printf("\nI have chosen a number between 0 and 20, which you must guess. \n"); for(numberOfGuesses = 5; numberOfGuesses > 0; --numberOfGuesses) { printf("\nYou have %d tr%s left.", numberOfGuesses, numberOfGuesses == 1 ? "y" : "ies"); printf("\nEnter a guess: "); scanf("%d", &guess); if(guess == randomNumber) { print...