fork download
  1. class prev {
  2. public static void main(String[] arg) {
  3. int num = 22;
  4. if(num%10 >= 5)
  5. {
  6. int number = num/10 *10;
  7. int next = number + 10;
  8. System.out.println(next);
  9. }
  10. else
  11. {
  12. int prev = num/10 *10;
  13. System.out.println(prev);
  14. }
  15. }
  16. }
  17.  
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
20