#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<stdlib.h>
#include<time.h> void menu() {
printf("*******************************************\n"); printf("*********
1.play ***********\n"); printf("********* 0.exit ***********\n");
printf("*******************************************\n"); } void game() { int
guess = 0; int r = rand() % 100 + 1; while (1) { printf(" Guess the number :>"); scanf("%d",
&guess); if (guess < r) { printf(" Guess it's small \n"); } else if (guess > r) {
printf(" Guess big \n"); } else { printf(" congratulations , You guessed right \n"); break; } } } int main() { int
input = 0; srand((unsigned int)time(NULL)); do { menu(); printf(" Please select :>");
scanf("%d", &input); switch (input) { case 1: game(); break; case 0:
printf(" Exit the game \n"); break; default: printf(" Selection error \n"); break; } } while (input);
return 0; }
Technology