Advertisement
semsem_elazazy

practical 14

Dec 30th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.    int n;
  6.    
  7.    printf("Enter a number (between 1 and 10):");
  8.    scanf("%d",&n);
  9.    
  10.    while(n!=5)
  11.    {
  12.    if(n<5) printf("Too low! Try again!\n");
  13.    
  14.    else printf("Too high! Try again!\n");
  15.    
  16.    printf("\nEnter a number (between 1 and 10):");
  17.    scanf("%d",&n);
  18.    }
  19.        printf("\nCongratulations! You guessed it!");
  20.    
  21.    
  22.    
  23.    
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement