The first guess digital game in C Language
# Include <stdio. h> # include <Windows. h> # include <stdlib. h> # include <stdio. h> # include <Windows. h> # include <stdlib. h> # include <time. h> void output () {printf *********** * *********** \ n "); printf ("********************** enter 1 to enter the guess digital game *********** * *********** \ n "); printf ("********************* enter 0 to exit the guess digital game *********** * *********** \ n ");} int main () {int charge = 1; while (charge) {output (); printf ("SELECT>:"); scanf ("% d", & charge ); switch (charge) {case 1: {int value = 0, input = 0; srand (unsigned int) time (NULL); value = rand () % 101; while (1) {printf ("Enter the number you guessed:"); scanf ("% d", & input); if (input <value) {printf ("You answered \ n");} else if (input> value) {printf ("You answered too much \ n ");} else {printf (" \ n"); break ;}} break;} default: {printf ("game end \ n"); break ;}}} system ("pause"); return 0 ;}