+ 2

I need your help ! 😥

my code gives error ! can someone tell me what i do wrong ? ps. yes i start learning java today https://code.sololearn.com/cYvEJTn6NYYd/?ref=app

25th Aug 2017, 8:11 PM
Carlos Castro
Carlos Castro - avatar
2 odpowiedzi
+ 20
import java.util.*; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int age = sc.nextInt(); if(age <= 10) { System.out.println("young"); } else if(age <= 19 && age > 10) { System.out.println("teenager"); } else if(age <= 30 && age > 19) { System.out.println("adult"); } else if(age <= 90 && age > 30) { System.out.println("old"); } else{ System.out.println("compile error"); } } }
25th Aug 2017, 8:17 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 2
oh thank you soo much 😉
25th Aug 2017, 8:24 PM
Carlos Castro
Carlos Castro - avatar