/* hadej.c - simple "guess number" game implementation 2023/02/19 Tomas Kolousek - created, used as example for binary app. modification */ #include int main(void) { srand(time(NULL)); int number = rand()%100+1; // 1..100 int attempt=1; int guess=0; printf("GuessGPT: Thinking about number between 1 and 100, can you guess it?\n"); do { printf("Attempt %d: your try?",attempt++); scanf("%d",&guess); // wrong, possible sigseg here, why? if (guessnumber) printf("Your guess is too high, try again.\n"); else printf("Great, your guess is same like my number!\n"); } while (guess != number); }