new file l4.c
This commit is contained in:
parent
91570904ff
commit
e3dbc13e9a
1 changed files with 23 additions and 0 deletions
23
c/l4.c
Normal file
23
c/l4.c
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue