From 69107ea26003e942bcce64b0b3a57a7c8952137b Mon Sep 17 00:00:00 2001 From: Stepan Date: Thu, 7 May 2026 19:07:58 +0300 Subject: [PATCH] update l4.c --- c/l4.c | 14 ++++++++++++-- c/l5.c | 0 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 c/l5.c diff --git a/c/l4.c b/c/l4.c index 0a223e6..31a413e 100644 --- a/c/l4.c +++ b/c/l4.c @@ -1,17 +1,27 @@ #include +#include +#include + int main() { - int x = 7; + srand(time(NULL)); + int x = rand() % 11; int s = 0; while(1) { int pol; printf("Number "); scanf("%d", &pol); - if(pol == 7) { + if(pol == x) { printf("the number is guessed\n"); break; } else { printf("the number is not guessed\n"); + if(pol > x) { + printf("less\n"); + } + else { + printf("more\n"); + } s++; if(s == 3) { printf("Game over\n"); diff --git a/c/l5.c b/c/l5.c new file mode 100644 index 0000000..e69de29