Browse Source

new file l4.c

Stepan 2 tháng trước cách đây
mục cha
commit
e3dbc13e9a
1 tập tin đã thay đổi với 23 bổ sung0 xóa
  1. 23 0
      c/l4.c

+ 23 - 0
c/l4.c

@@ -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;
+}