Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. Given 2 positive int values, return the larger value that is in the range 10..20 inclusive, or return 0 if neither is in that range.
  2.  
  3. public int max1020(int a, int b) {
  4. if( a < 10 || a > 20 && b < 10 || b > 20 )
  5. return 0;
  6.  
  7. if( a > b )
  8. return a;
  9. else
  10. return b;
  11. }
Add Comment
Please, Sign In to add comment