Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- srand(time(0));
- int number = rand() % 100 + 1;
- int guess;
- do {
- printf("Enter your estimate: ");
- scanf("%d",&guess);
- if (guess < number)
- printf("Your estimate is less, than the secret number \r\n");
- else if (guess > number)
- printf("Your estimate is more, than the secret number \r\n");
- else
- printf("Your guess is right! \r\n");
- } while (guess != number);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement