From e3dbc13e9a032c75ae3a09ef2efc20e0a0d3377c Mon Sep 17 00:00:00 2001 From: Stepan Date: Thu, 7 May 2026 14:48:02 +0300 Subject: [PATCH] new file l4.c --- c/l4.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 c/l4.c diff --git a/c/l4.c b/c/l4.c new file mode 100644 index 0000000..0a223e6 --- /dev/null +++ b/c/l4.c @@ -0,0 +1,23 @@ +#include +int main() { + int x = 7; + int s = 0; + while(1) { + int pol; + printf("Number "); + scanf("%d", &pol); + if(pol == 7) { + printf("the number is guessed\n"); + break; + } + else { + printf("the number is not guessed\n"); + s++; + if(s == 3) { + printf("Game over\n"); + break; + } + } + } + return 0; +} \ No newline at end of file