Advertisement
kozdiabka

If else if in Grrovy

Jan 30th, 2023
703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1.  
  2. int age = 105;
  3.  
  4. if (age < 20)
  5. {
  6.     if (age >=0 && age < 6)
  7.     {
  8.         return "small baby";
  9.     }
  10.     else if (age >=6 && age < 18)
  11.     {
  12.         return "go to school";
  13.     }
  14.     else if (age >=18)
  15.     {
  16.         return "go to SVO";
  17.     }
  18. }
  19. else if (age > 60 && age < 100)
  20. {
  21.     return "retirement";   
  22. }
  23. else
  24.     return "too old";
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement