new file l4.c

This commit is contained in:
Stepan 2026-05-07 14:48:02 +03:00
parent 91570904ff
commit e3dbc13e9a

23
c/l4.c Normal file
View file

@ -0,0 +1,23 @@
#include <stdio.h>
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;
}