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