l4.c 462 B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. int main() {
  3. int x = 7;
  4. int s = 0;
  5. while(1) {
  6. int pol;
  7. printf("Number ");
  8. scanf("%d", &pol);
  9. if(pol == 7) {
  10. printf("the number is guessed\n");
  11. break;
  12. }
  13. else {
  14. printf("the number is not guessed\n");
  15. s++;
  16. if(s == 3) {
  17. printf("Game over\n");
  18. break;
  19. }
  20. }
  21. }
  22. return 0;
  23. }