Small game with C language
# Include <stdio. h> # include <stdlib. h> # include <time. h> void fun (int c) {srand (unsigned) time (NULL); int ret = rand () % 100 + 1; printf ("enter a number>"); while (1) {scanf ("% d", & c); if (c = ret) {printf ("correct \ n"); break;} else if (c> ret) {printf ("guessed big \ n ");} else {printf ("guessed it \ n") ;}} void menu () {printf ("********************** \ n "); printf ("***** starting the game ********* \ n "); printf ("********************** \ n "); printf ("****** select *********** \ n "); printf ("********************** \ n "); printf ("***** 1 game start ******* \ n "); printf ("********************** \ n "); printf ("***** 2 game end ******* \ n "); printf ("********************** \ n "); printf ("********************* \ n");} int main () {int c = 0; int num = 0; int input = 0; while (1) {menu (); printf ("select \ n"); scanf ("% d", & input ); switch (input) {case 1: printf ("Game start \ n"); fun (num); break; {case 2: printf ("game end \ n "); break; }}// break;} printf ("% d", c); system ("pause"); return 0;