Advertisement
ArtisOracle

Read in C

Sep 21st, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. int main() {
  2.     double input1, input2;
  3.     while (true) {
  4.         printf("Input two numbers between 0 and 127.\n");
  5.         printf("Input 1:");
  6.         scanf(%f, input1);
  7.         printf("\nInput 2:");
  8.         scanf(%f, input2);
  9.  
  10.         if (input1 >= 0 && input1 <= 127 &&
  11.             input2 >0 && input2 <= 127)
  12.             break;
  13.         else
  14.             printf("Your input values are invalid. Try again.\n\n");
  15.     }
  16.    
  17.     // STUFF   
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement