class Main {
public static void main(String[] args) {
int number = 12;
if(number % 3 == 0){
System.out.println("Dividable by 3");
else if(number % 3 == 1){
System.out.println("Divide by 3 to get 1 surplus");
else
System.out.println("Divide by 3 to get 2");
}
}
}
class Main {
public static void main(String[] args) {
int number = 12;
switch(number % 3){
case 0:
System.out.println("Dividable by 3");
break;
case 1:
System.out.println("Divide by 3 to get 1 surplus");
break;
case 2:
System.out.println("Divide by 3 to get 2");
break;
}
}
}
Recommended Posts