Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n;
- printf("Enter a number (between 1 and 10):");
- scanf("%d",&n);
- while(n)
- {
- if(n<5)
- printf("Too low! Try again!");
- else if (n>5)
- printf("Too high! Try again!");
- else if (n==5)
- {
- printf("Congratulations! You guessed it!");
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement